diff options
author | Selim Cinek <cinek@google.com> | 2015-05-08 02:04:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-08 02:04:52 +0000 |
commit | 03fdca1b29aff07583b7764b7b359cbbfc58e577 (patch) | |
tree | afff737e489e01729c6625d763afe713b05d896c /packages | |
parent | 1f8619974806d1c461b57ab232c50f1845d4d433 (diff) | |
parent | 4a4a2bddc48a33cbaa49a8844b9fd36e2fc5e219 (diff) | |
download | frameworks_base-03fdca1b29aff07583b7764b7b359cbbfc58e577.zip frameworks_base-03fdca1b29aff07583b7764b7b359cbbfc58e577.tar.gz frameworks_base-03fdca1b29aff07583b7764b7b359cbbfc58e577.tar.bz2 |
Merge "Fixed a bug where the heads-up would not show when full screen" into mnc-dev
Diffstat (limited to 'packages')
3 files changed, 38 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java index 4542054..80fdd28 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java @@ -157,7 +157,8 @@ public class CommandQueue extends IStatusBar.Stub { public void setSystemUiVisibility(int vis, int mask) { synchronized (mList) { - mHandler.removeMessages(MSG_SET_SYSTEMUI_VISIBILITY); + // Don't coalesce these, since it might have one time flags set such as + // STATUS_BAR_UNHIDE which might get lost. mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY, vis, mask, null).sendToTarget(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 351977b..471196c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -529,6 +529,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, = new HashMap<>(); private HashSet<Entry> mHeadsUpEntriesToRemoveOnSwitch = new HashSet<>(); private RankingMap mLatestRankingMap; + private boolean mNoAnimationOnNextBarModeChange; @Override public void start() { @@ -1709,6 +1710,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, * State is one or more of the DISABLE constants from StatusBarManager. */ public void disable(int state1, int state2, boolean animate) { + animate &= mStatusBarWindowState != WINDOW_STATE_HIDDEN; mDisabledUnmodified1 = state1; mDisabledUnmodified2 = state2; state1 = adjustDisableFlags(state1); @@ -1868,6 +1870,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public void onHeadsUpPinnedModeChanged(boolean inPinnedMode) { if (inPinnedMode) { mStatusBarWindowManager.setHeadsUpShowing(true); + mStatusBarWindowManager.setForceStatusBarVisible(true); } else { Runnable endRunnable = new Runnable() { @Override @@ -2132,6 +2135,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // Shrink the window to the size of the status bar only mStatusBarWindowManager.setStatusBarExpanded(false); + mStatusBarWindowManager.setForceStatusBarVisible(false); mStatusBarView.setFocusable(true); // Close any "App info" popups that might have snuck on-screen @@ -2272,6 +2276,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, setAreThereNotifications(); } + // ready to unhide + if ((vis & View.STATUS_BAR_UNHIDE) != 0) { + mSystemUiVisibility &= ~View.STATUS_BAR_UNHIDE; + mNoAnimationOnNextBarModeChange = true; + } + // update status bar mode final int sbMode = computeBarMode(oldVal, newVal, mStatusBarView.getBarTransitions(), View.STATUS_BAR_TRANSIENT, View.STATUS_BAR_TRANSLUCENT); @@ -2303,10 +2313,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } - // ready to unhide - if ((vis & View.STATUS_BAR_UNHIDE) != 0) { - mSystemUiVisibility &= ~View.STATUS_BAR_UNHIDE; - } if ((vis & View.NAVIGATION_BAR_UNHIDE) != 0) { mSystemUiVisibility &= ~View.NAVIGATION_BAR_UNHIDE; } @@ -2351,17 +2357,21 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private void checkBarModes() { if (mDemoMode) return; - checkBarMode(mStatusBarMode, mStatusBarWindowState, mStatusBarView.getBarTransitions()); + checkBarMode(mStatusBarMode, mStatusBarWindowState, mStatusBarView.getBarTransitions(), + mNoAnimationOnNextBarModeChange); if (mNavigationBarView != null) { checkBarMode(mNavigationBarMode, - mNavigationBarWindowState, mNavigationBarView.getBarTransitions()); + mNavigationBarWindowState, mNavigationBarView.getBarTransitions(), + mNoAnimationOnNextBarModeChange); } + mNoAnimationOnNextBarModeChange = false; } - private void checkBarMode(int mode, int windowState, BarTransitions transitions) { + private void checkBarMode(int mode, int windowState, BarTransitions transitions, + boolean noAnimation) { final boolean powerSave = mBatteryController.isPowerSave(); - final boolean anim = (mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN - && !powerSave; + final boolean anim = !noAnimation && (mScreenOn == null || mScreenOn) + && windowState != WINDOW_STATE_HIDDEN && !powerSave; if (powerSave && getBarState() == StatusBarState.SHADE) { mode = MODE_WARNING; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java index 84a9f64..e7e4384 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java @@ -166,6 +166,7 @@ public class StatusBarWindowManager { private void apply(State state) { applyKeyguardFlags(state); + applyForceStatusBarVisibleFlag(state); applyFocusableFlag(state); adjustScreenOrientation(state); applyHeight(state); @@ -178,6 +179,16 @@ public class StatusBarWindowManager { } } + private void applyForceStatusBarVisibleFlag(State state) { + if (state.forceStatusBarVisible) { + mLpChanged.privateFlags |= WindowManager + .LayoutParams.PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT; + } else { + mLpChanged.privateFlags &= ~WindowManager + .LayoutParams.PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT; + } + } + private void applyModalFlag(State state) { if (state.headsUpShowing) { mLpChanged.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; @@ -240,6 +251,11 @@ public class StatusBarWindowManager { apply(mCurrentState); } + public void setForceStatusBarVisible(boolean forceStatusBarVisible) { + mCurrentState.forceStatusBarVisible = forceStatusBarVisible; + apply(mCurrentState); + } + private static class State { boolean keyguardShowing; boolean keyguardOccluded; @@ -250,6 +266,7 @@ public class StatusBarWindowManager { boolean keyguardFadingAway; boolean qsExpanded; boolean headsUpShowing; + boolean forceStatusBarVisible; /** * The {@link BaseStatusBar} state from the status bar. |