diff options
author | James Nylen <jnylen@gmail.com> | 2010-12-02 14:07:33 -0500 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2010-12-03 15:18:17 -0500 |
commit | 25eee5c4ef1f3e3126363f2a101af4f9237170bc (patch) | |
tree | 6e235d04327ea3612fa29eb0dce1ccabb45f2d2c | |
parent | ffa2badfa7c6b1f84c3f671850833ebc94581843 (diff) | |
download | frameworks_base-25eee5c4ef1f3e3126363f2a101af4f9237170bc.zip frameworks_base-25eee5c4ef1f3e3126363f2a101af4f9237170bc.tar.gz frameworks_base-25eee5c4ef1f3e3126363f2a101af4f9237170bc.tar.bz2 |
Add setting to hide notification pulldown after clicking a power widget button
Change-Id: Ibbb2da79ef93502990d122d1f31664e578a44a79
-rw-r--r-- | core/java/android/provider/Settings.java | 6 | ||||
-rw-r--r-- | services/java/com/android/server/status/StatusBarService.java | 17 |
2 files changed, 22 insertions, 1 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/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) { |