diff options
5 files changed, 38 insertions, 15 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 758b65b..b0e0b1e 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2272,6 +2272,12 @@ public final class Settings { public static final String EXPANDED_VIEW_WIDGET = "expanded_view_widget"; /** + * Whether to hide the notification screen after clicking on a widget button + * @hide + */ + public static final String EXPANDED_HIDE_ONCHANGE = "expanded_hide_onchange"; + + /** * Notification Indicator Color * @hide */ diff --git a/services/java/com/android/server/LightsService.java b/services/java/com/android/server/LightsService.java index 7c0a80e..c70aab9 100644 --- a/services/java/com/android/server/LightsService.java +++ b/services/java/com/android/server/LightsService.java @@ -109,19 +109,19 @@ public class LightsService { public void pulse(int color, int onMS) { synchronized (this) { - if (mColor == 0 && !mFlashing) { + if (mColor == 0 && !mFlashing) { setLightLocked(color, LIGHT_FLASH_HARDWARE, onMS, 1000, BRIGHTNESS_MODE_USER); mH.sendMessageDelayed(Message.obtain(mH, 1, this), onMS); } } } - public void notificationPulse(int color, int onMs, int offMs) { - synchronized (this) { - setLightLocked(color, LIGHT_FLASH_TIMED, onMs, 1000, BRIGHTNESS_MODE_USER); - mH.sendMessageDelayed(Message.obtain(mH, 1, this), onMs); - } - } + public void notificationPulse(int color, int onMs, int offMs) { + synchronized (this) { + setLightLocked(color, LIGHT_FLASH_TIMED, onMs, offMs, BRIGHTNESS_MODE_USER); + mH.sendMessageDelayed(Message.obtain(mH, 1, this), onMs); + } + } public void turnOff() { synchronized (this) { @@ -216,7 +216,7 @@ public class LightsService { @Override public void handleMessage(Message msg) { Light light = (Light)msg.obj; - light.stopFlashing(); + light.turnOff(); } }; diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 8207146..7534070 100644 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -42,6 +42,7 @@ import android.media.AudioManager; import android.net.Uri; import android.os.BatteryManager; import android.os.Binder; +import android.os.Build; import android.os.Handler; import android.os.IBinder; import android.os.Message; @@ -1396,6 +1397,7 @@ class NotificationManagerService extends INotificationManager.Stub { } private void updateRGBLightsLocked() { + boolean SHOLES_DEVICE = Build.DEVICE.contains("sholes"); int mPulseScreen = Settings.System.getInt(mContext.getContentResolver(), Settings.System.TRACKBALL_SCREEN_ON, 0); int mSuccession = Settings.System.getInt(mContext.getContentResolver(), @@ -1413,6 +1415,10 @@ class NotificationManagerService extends INotificationManager.Stub { mPulseAllColor = 0; } + if (SHOLES_DEVICE) { + mBlendColor = 0; + } + // Battery low always shows, other states only show if charging. if (mBatteryLow) { if (mBatteryCharging) { diff --git a/services/java/com/android/server/status/StatusBarService.java b/services/java/com/android/server/status/StatusBarService.java index 88de4c9..683e634 100644 --- a/services/java/com/android/server/status/StatusBarService.java +++ b/services/java/com/android/server/status/StatusBarService.java @@ -286,6 +286,7 @@ public class StatusBarService extends IStatusBar.Stub int mDisabled = 0; private HashMap<String,PowerButton> mUsedPowerButtons = new HashMap<String,PowerButton>(); + private boolean mHideOnPowerButtonChange = false; /** * Construct the service, add the status bar view to the window manager @@ -1927,6 +1928,9 @@ public class StatusBarService extends IStatusBar.Stub PowerButton btn = mUsedPowerButtons.get(type); btn.toggleState(mContext); updateWidget(); + if(mHideOnPowerButtonChange) { + deactivate(); + } } }; @@ -1951,6 +1955,9 @@ public class StatusBarService extends IStatusBar.Stub setupWidget(buttonType, posi + 1); } updateWidget(); + + mHideOnPowerButtonChange = (Settings.System.getInt(mContext.getContentResolver(), + Settings.System.EXPANDED_HIDE_ONCHANGE, 0) == 1); } private void setupWidget(String buttonType, int position) { @@ -2305,6 +2312,10 @@ public class StatusBarService extends IStatusBar.Stub false, this); resolver.registerContentObserver( + Settings.System.getUriFor(Settings.System.EXPANDED_HIDE_ONCHANGE), + false, this); + + resolver.registerContentObserver( Settings.System.getUriFor(Settings.System.SCREEN_BRIGHTNESS_MODE), false, this); @@ -2354,7 +2365,11 @@ public class StatusBarService extends IStatusBar.Stub } } else if (uri.equals(Settings.System.getUriFor(Settings.System.WIDGET_BUTTONS))) { setupPowerWidget(); - } else if (uri.equals(Settings.System.getUriFor(Settings.System.EXPANDED_VIEW_WIDGET))) { + } else if (uri.equals(Settings.System.getUriFor( + Settings.System.EXPANDED_HIDE_ONCHANGE))) { + setupPowerWidget(); + } else if (uri.equals(Settings.System.getUriFor( + Settings.System.EXPANDED_VIEW_WIDGET))) { boolean powerWidget = Settings.System.getInt(mContext.getContentResolver(), Settings.System.EXPANDED_VIEW_WIDGET, 1) == 1; if(!powerWidget) { diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java index 36de23b..68a6b45 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java @@ -1293,11 +1293,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { String spn; - if (!mvnoRoaming) { - spn = SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA, "empty"); - } else { - spn = SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA, ""); - } + spn = SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA, "empty"); String onsl = s.getOperatorAlphaLong(); String onss = s.getOperatorAlphaShort(); @@ -1316,7 +1312,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { } catch (Exception e){ } - return gsmRoaming && !(equalsMcc && (equalsOnsl || equalsOnss)); + return gsmRoaming && !(equalsMcc && (equalsOnsl || equalsOnss || mvnoRoaming)); } private static int twoDigitsAt(String s, int offset) { |