summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2015-05-07 12:50:19 -0700
committerSelim Cinek <cinek@google.com>2015-05-07 16:54:05 -0700
commit4a4a2bddc48a33cbaa49a8844b9fd36e2fc5e219 (patch)
tree7a7e665143d4ff26e4cee020e85f8a372166a088 /packages
parent81e36fe7c21484d8030d9600a330b64e6dd2dbd0 (diff)
downloadframeworks_base-4a4a2bddc48a33cbaa49a8844b9fd36e2fc5e219.zip
frameworks_base-4a4a2bddc48a33cbaa49a8844b9fd36e2fc5e219.tar.gz
frameworks_base-4a4a2bddc48a33cbaa49a8844b9fd36e2fc5e219.tar.bz2
Fixed a bug where the heads-up would not show when full screen
Bug: 20728541 Change-Id: I74bc74c4936b003a4c0c37b7c7da2d1fa138c077
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java28
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java17
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 f3335af..69ede4a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -528,6 +528,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() {
@@ -1702,6 +1703,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);
@@ -1861,6 +1863,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
@@ -2125,6 +2128,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
@@ -2265,6 +2269,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);
@@ -2296,10 +2306,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;
}
@@ -2344,17 +2350,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.