summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorPedlar <pedlar88@gmail.com>2010-08-06 02:48:06 -0400
committerPedlar <pedlar88@gmail.com>2010-08-06 02:48:06 -0400
commit619a4963093e84e293955332b750b9b7866f1668 (patch)
tree6385f4df8d84e16cd4427b5d8209f58f11cc4a91 /services/java
parent1d9eb74a205b3a982b6151a79001a3d2a9f0ff03 (diff)
downloadframeworks_base-619a4963093e84e293955332b750b9b7866f1668.zip
frameworks_base-619a4963093e84e293955332b750b9b7866f1668.tar.gz
frameworks_base-619a4963093e84e293955332b750b9b7866f1668.tar.bz2
Bug Fixes
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/LightsService.java10
-rwxr-xr-xservices/java/com/android/server/NotificationManagerService.java39
2 files changed, 16 insertions, 33 deletions
diff --git a/services/java/com/android/server/LightsService.java b/services/java/com/android/server/LightsService.java
index 4b38e25..3ec1bc4 100644
--- a/services/java/com/android/server/LightsService.java
+++ b/services/java/com/android/server/LightsService.java
@@ -23,6 +23,7 @@ import android.os.IHardwareService;
import android.os.ServiceManager;
import android.os.Message;
import android.util.Slog;
+import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
@@ -104,7 +105,7 @@ public class LightsService {
public void notificationPulse(int color, int onMs, int offMs) {
synchronized (this) {
- setLightLocked(color, LIGHT_FLASH_PULSE, onMs, 1000, BRIGHTNESS_MODE_USER);
+ setLightLocked(color, LIGHT_FLASH_HARDWARE, onMs, 1000, BRIGHTNESS_MODE_USER);
mH.sendMessageDelayed(Message.obtain(mH, 1, this), onMs);
}
}
@@ -128,15 +129,14 @@ public class LightsService {
mOnMS = onMS;
mOffMS = offMS;
setLight_native(mNativePointer, mId, color, LIGHT_FLASH_HARDWARE, onMS, offMS, brightnessMode);
- return;
}
- else if (color != mColor || mode != mMode || onMS != mOnMS || offMS != mOffMS) {
- */ mColor = color;
+ else*/ if (color != mColor || mode != mMode || onMS != mOnMS || offMS != mOffMS) {
+ mColor = color;
mMode = mode;
mOnMS = onMS;
mOffMS = offMS;
setLight_native(mNativePointer, mId, color, mode, onMS, offMS, brightnessMode);
- //}
+ }
}
private int mId;
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index c89cc45..a85131c 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -1070,7 +1070,7 @@ class NotificationManagerService extends INotificationManager.Stub
updateLightsLocked();
}
}
-
+
public boolean isNull(String mString) {
if(mString == null || mString.matches("null")
|| mString.length() == 0
@@ -1081,7 +1081,7 @@ class NotificationManagerService extends INotificationManager.Stub
return false;
}
}
-
+
//Grab our Array Information For Lights
public String[] getArray(String mGetFrom) {
if(isNull(mGetFrom)) {
@@ -1090,7 +1090,7 @@ class NotificationManagerService extends INotificationManager.Stub
String[] temp = mGetFrom.split("\\|");
return temp;
}
-
+
public String[] getPackageInfo(String mString) {
if(mString == null || mString == "=" || mString.length() == 0) {
return null;
@@ -1099,30 +1099,13 @@ class NotificationManagerService extends INotificationManager.Stub
temp = mString.split("=");
return temp;
}
-
+
public class StartTimerClass implements Runnable {
private long sleepTimer;
public StartTimerClass(long timer) {
sleepTimer = timer;
}
-
-/* public void run() {
- powerWake.acquire();
- try {
- while(hasLights == true) {
- Thread.sleep(sleepTimer);
- updateLights();
- Log.i("StartTimer", "Pulsing light after sleeping for "+sleepTimer);
- }
- } catch (InterruptedException e) {
- Log.e("StartClass Sleep", e.toString());
- }
- powerWake.release();
- threadExecutor = null;
- Log.i("StartTimer", "Ended");
- }
-*/
public void run() {
powerWake.acquire(sleepTimer);
try {
@@ -1194,7 +1177,7 @@ class NotificationManagerService extends INotificationManager.Stub
mNotificationLight.turnOff();
hasLights = false;
isTimer = false;
- } else {
+ } else {
hasLights = true;
if(mSuccession == 1) {
int n = mLights.size();
@@ -1209,7 +1192,6 @@ class NotificationManagerService extends INotificationManager.Stub
if((thisLight == (mLastLight - 1)) || (thisLight > n)) {
thisLight = 1;
}
-// Log.i("Succession", "mLights.size="+n+" thisLight: "+thisLight+" mLastLight: " +mLastLight+" mLights: " + mLights.toString());
mLedNotification = mLights.get(thisLight-1);
mLastLight = thisLight;
}
@@ -1222,6 +1204,7 @@ class NotificationManagerService extends INotificationManager.Stub
ledOnMS = mDefaultNotificationLedOn;
ledOffMS = mDefaultNotificationLedOff;
}
+ Log.i("ledOffMS", "Default ledOffMS="+ledOffMS+" ledOnMS="+ledOnMS);
//Possible Cleaner way?
//String[] mPackageInfo = findPackage(mLedNotification.pkg);
//if(mPackageInfo != null) {
@@ -1230,6 +1213,7 @@ class NotificationManagerService extends INotificationManager.Stub
//}
if(mPackages != null) {
int i = 0;
+ Log.i("PackageList", mPackageList);
for(i = 0; i < mPackages.length; i++) {
String[] mPackageInfo = getPackageInfo(mPackages[i]);
if(mPackageInfo == null) {
@@ -1243,7 +1227,7 @@ class NotificationManagerService extends INotificationManager.Stub
} else {
ledARGB = Color.parseColor(mPackageInfo[1]);
}
- ledOffMS = Integer.parseInt(mPackageInfo[2]);
+ ledOffMS = (Integer.parseInt(mPackageInfo[2]) * 1000);
}
}
}
@@ -1256,7 +1240,8 @@ class NotificationManagerService extends INotificationManager.Stub
} else if(mPulseAllColor == 1) {
if(lastColor >= colorList.length)
lastColor = 1;
- ledARGB = Color.parseColor(colorList[lastColor - 1]);
+
+ ledARGB = Color.parseColor(colorList[lastColor - 1]);
lastColor = lastColor + 1;
}
@@ -1280,13 +1265,11 @@ class NotificationManagerService extends INotificationManager.Stub
isTimer = true;
threadExecutor.execute(timerRun);
}
- Log.i("SetTimer", "Set Flash off time: "+ledOffMS);
mNotificationLight.notificationPulse(ledARGB, ledOnMS, ledOffMS);
} else {
//We are going to divide the time in half, as it seems long when normal.
mNotificationLight.setFlashing(ledARGB, LightsService.LIGHT_FLASH_TIMED,
- ledOnMS, (ledOffMS/2));
- Log.i("SetFlashing", "Set Flash off time: "+(ledOffMS/2));
+ ledOnMS, ledOffMS);
}
} else {
// pulse only once