Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +3 −21 Original line number Diff line number Diff line Loading @@ -93,14 +93,14 @@ public abstract class BaseStatusBar extends SystemUI implements protected static final boolean ENABLE_HEADS_UP = true; // scores above this threshold should be displayed in heads up mode. private static final int INTERRUPTION_THRESHOLD = 11; protected static final int INTERRUPTION_THRESHOLD = 11; protected static final String SETTING_HEADS_UP = "heads_up_enabled"; // Should match the value in PhoneWindowManager public static final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps"; public static final int EXPANDED_LEAVE_ALONE = -10000; public static final int EXPANDED_FULL_OPEN = -10001; private static final String SETTING_HEADS_UP = "heads_up_enabled"; protected CommandQueue mCommandQueue; protected IStatusBarService mBarService; Loading @@ -125,7 +125,7 @@ public abstract class BaseStatusBar extends SystemUI implements protected int mLayoutDirection; private Locale mLocale; protected boolean mUseHeadsUp = true; protected boolean mUseHeadsUp = false; protected IDreamManager mDreamManager; KeyguardManager mKeyguardManager; Loading Loading @@ -170,19 +170,6 @@ public abstract class BaseStatusBar extends SystemUI implements } }; final private ContentObserver mHeadsUpObserver = new ContentObserver(mHandler) { @Override public void onChange(boolean selfChange) { mUseHeadsUp = ENABLE_HEADS_UP && 0 != Settings.Global.getInt( mContext.getContentResolver(), SETTING_HEADS_UP, 0); Log.d(TAG, "heads up is " + (mUseHeadsUp ? "enabled" : "disabled")); if (!mUseHeadsUp) { Log.d(TAG, "dismissing any existing heads up notification on disable event"); mHandler.sendEmptyMessage(MSG_HIDE_HEADS_UP); } } }; private RemoteViews.OnClickHandler mOnClickHandler = new RemoteViews.OnClickHandler() { @Override public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) { Loading Loading @@ -242,11 +229,6 @@ public abstract class BaseStatusBar extends SystemUI implements Settings.Global.getUriFor(Settings.Global.DEVICE_PROVISIONED), true, mProvisioningObserver); mHeadsUpObserver.onChange(false); // set up mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(SETTING_HEADS_UP), true, mHeadsUpObserver); mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +30 −1 Original line number Diff line number Diff line Loading @@ -304,6 +304,25 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { } }; final private ContentObserver mHeadsUpObserver = new ContentObserver(mHandler) { @Override public void onChange(boolean selfChange) { boolean wasUsing = mUseHeadsUp; mUseHeadsUp = ENABLE_HEADS_UP && 0 != Settings.Global.getInt( mContext.getContentResolver(), SETTING_HEADS_UP, 0); Log.d(TAG, "heads up is " + (mUseHeadsUp ? "enabled" : "disabled")); if (wasUsing != mUseHeadsUp) { if (!mUseHeadsUp) { Log.d(TAG, "dismissing any existing heads up notification on disable event"); mHandler.sendEmptyMessage(MSG_HIDE_HEADS_UP); removeHeadsUpView(); } else { addHeadsUpView(); } } } }; private int mInteractingWindows; private boolean mAutohideSuspended; private int mStatusBarMode; Loading Loading @@ -331,6 +350,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { // Lastly, call to the icon policy to install/update all the icons. mIconPolicy = new PhoneStatusBarPolicy(mContext); mHeadsUpObserver.onChange(true); // set up if (ENABLE_HEADS_UP) { mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(SETTING_HEADS_UP), true, mHeadsUpObserver); } } // ================================================================================ Loading Loading @@ -816,6 +842,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { mWindowManager.addView(mHeadsUpNotificationView, lp); } private void removeHeadsUpView() { mWindowManager.removeView(mHeadsUpNotificationView); } public void refreshAllStatusBarIcons() { refreshAllIconsForLayout(mStatusIcons); refreshAllIconsForLayout(mNotificationIcons); Loading Loading @@ -2179,7 +2209,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { @Override public void createAndAddWindows() { addStatusBarWindow(); if (ENABLE_HEADS_UP) addHeadsUpView(); } private void addStatusBarWindow() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +3 −21 Original line number Diff line number Diff line Loading @@ -93,14 +93,14 @@ public abstract class BaseStatusBar extends SystemUI implements protected static final boolean ENABLE_HEADS_UP = true; // scores above this threshold should be displayed in heads up mode. private static final int INTERRUPTION_THRESHOLD = 11; protected static final int INTERRUPTION_THRESHOLD = 11; protected static final String SETTING_HEADS_UP = "heads_up_enabled"; // Should match the value in PhoneWindowManager public static final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps"; public static final int EXPANDED_LEAVE_ALONE = -10000; public static final int EXPANDED_FULL_OPEN = -10001; private static final String SETTING_HEADS_UP = "heads_up_enabled"; protected CommandQueue mCommandQueue; protected IStatusBarService mBarService; Loading @@ -125,7 +125,7 @@ public abstract class BaseStatusBar extends SystemUI implements protected int mLayoutDirection; private Locale mLocale; protected boolean mUseHeadsUp = true; protected boolean mUseHeadsUp = false; protected IDreamManager mDreamManager; KeyguardManager mKeyguardManager; Loading Loading @@ -170,19 +170,6 @@ public abstract class BaseStatusBar extends SystemUI implements } }; final private ContentObserver mHeadsUpObserver = new ContentObserver(mHandler) { @Override public void onChange(boolean selfChange) { mUseHeadsUp = ENABLE_HEADS_UP && 0 != Settings.Global.getInt( mContext.getContentResolver(), SETTING_HEADS_UP, 0); Log.d(TAG, "heads up is " + (mUseHeadsUp ? "enabled" : "disabled")); if (!mUseHeadsUp) { Log.d(TAG, "dismissing any existing heads up notification on disable event"); mHandler.sendEmptyMessage(MSG_HIDE_HEADS_UP); } } }; private RemoteViews.OnClickHandler mOnClickHandler = new RemoteViews.OnClickHandler() { @Override public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) { Loading Loading @@ -242,11 +229,6 @@ public abstract class BaseStatusBar extends SystemUI implements Settings.Global.getUriFor(Settings.Global.DEVICE_PROVISIONED), true, mProvisioningObserver); mHeadsUpObserver.onChange(false); // set up mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(SETTING_HEADS_UP), true, mHeadsUpObserver); mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +30 −1 Original line number Diff line number Diff line Loading @@ -304,6 +304,25 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { } }; final private ContentObserver mHeadsUpObserver = new ContentObserver(mHandler) { @Override public void onChange(boolean selfChange) { boolean wasUsing = mUseHeadsUp; mUseHeadsUp = ENABLE_HEADS_UP && 0 != Settings.Global.getInt( mContext.getContentResolver(), SETTING_HEADS_UP, 0); Log.d(TAG, "heads up is " + (mUseHeadsUp ? "enabled" : "disabled")); if (wasUsing != mUseHeadsUp) { if (!mUseHeadsUp) { Log.d(TAG, "dismissing any existing heads up notification on disable event"); mHandler.sendEmptyMessage(MSG_HIDE_HEADS_UP); removeHeadsUpView(); } else { addHeadsUpView(); } } } }; private int mInteractingWindows; private boolean mAutohideSuspended; private int mStatusBarMode; Loading Loading @@ -331,6 +350,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { // Lastly, call to the icon policy to install/update all the icons. mIconPolicy = new PhoneStatusBarPolicy(mContext); mHeadsUpObserver.onChange(true); // set up if (ENABLE_HEADS_UP) { mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(SETTING_HEADS_UP), true, mHeadsUpObserver); } } // ================================================================================ Loading Loading @@ -816,6 +842,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { mWindowManager.addView(mHeadsUpNotificationView, lp); } private void removeHeadsUpView() { mWindowManager.removeView(mHeadsUpNotificationView); } public void refreshAllStatusBarIcons() { refreshAllIconsForLayout(mStatusIcons); refreshAllIconsForLayout(mNotificationIcons); Loading Loading @@ -2179,7 +2209,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { @Override public void createAndAddWindows() { addStatusBarWindow(); if (ENABLE_HEADS_UP) addHeadsUpView(); } private void addStatusBarWindow() { Loading