summaryrefslogtreecommitdiffstats
path: root/services
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 /services
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 'services')
-rw-r--r--services/core/java/com/android/server/policy/BarController.java22
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java21
2 files changed, 39 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/policy/BarController.java b/services/core/java/com/android/server/policy/BarController.java
index e972ec7..5877b3e 100644
--- a/services/core/java/com/android/server/policy/BarController.java
+++ b/services/core/java/com/android/server/policy/BarController.java
@@ -58,6 +58,9 @@ public class BarController {
private int mTransientBarState;
private boolean mPendingShow;
private long mLastTranslucent;
+ private boolean mShowTransparent;
+ private boolean mSetUnHideFlagWhenNextTransparent;
+ private boolean mNoAnimationOnNextShow;
public BarController(String tag, int transientFlag, int unhideFlag, int translucentFlag,
int statusBarManagerId, int translucentWmFlag) {
@@ -74,6 +77,14 @@ public class BarController {
mWin = win;
}
+ public void setShowTransparent(boolean transparent) {
+ if (transparent != mShowTransparent) {
+ mShowTransparent = transparent;
+ mSetUnHideFlagWhenNextTransparent = transparent;
+ mNoAnimationOnNextShow = true;
+ }
+ }
+
public void showTransient() {
if (mWin != null) {
setTransientBarState(TRANSIENT_BAR_SHOW_REQUESTED);
@@ -135,7 +146,9 @@ public class BarController {
}
final boolean wasVis = mWin.isVisibleLw();
final boolean wasAnim = mWin.isAnimatingLw();
- final boolean change = show ? mWin.showLw(true) : mWin.hideLw(true);
+ final boolean change = show ? mWin.showLw(!mNoAnimationOnNextShow)
+ : mWin.hideLw(!mNoAnimationOnNextShow);
+ mNoAnimationOnNextShow = false;
final int state = computeStateLw(wasVis, wasAnim, mWin, change);
final boolean stateChanged = updateStateLw(state);
return change || stateChanged;
@@ -233,6 +246,13 @@ public class BarController {
setTransientBarState(TRANSIENT_BAR_NONE); // request denied
}
}
+ if (mShowTransparent) {
+ vis |= View.SYSTEM_UI_TRANSPARENT;
+ if (mSetUnHideFlagWhenNextTransparent) {
+ vis |= mUnhideFlag;
+ mSetUnHideFlagWhenNextTransparent = false;
+ }
+ }
if (mTransientBarState != TRANSIENT_BAR_NONE) {
vis |= mTransientFlag; // ignore clear requests until transition completes
vis &= ~View.SYSTEM_UI_FLAG_LOW_PROFILE; // never show transient bars in low profile
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 51503ec..5eee75d 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -476,6 +476,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean mTopIsFullscreen;
boolean mForceStatusBar;
boolean mForceStatusBarFromKeyguard;
+ private boolean mForceStatusBarTransparent;
boolean mHideLockScreen;
boolean mForcingShowNavBar;
int mForcingShowNavBarLayer;
@@ -4129,6 +4130,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mAppsThatDismissKeyguard.clear();
mForceStatusBar = false;
mForceStatusBarFromKeyguard = false;
+ mForceStatusBarTransparent = false;
mForcingShowNavBar = false;
mForcingShowNavBarLayer = -1;
@@ -4154,8 +4156,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mForcingShowNavBar = true;
mForcingShowNavBarLayer = win.getSurfaceLayer();
}
- if (attrs.type == TYPE_STATUS_BAR && (attrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0) {
- mForceStatusBarFromKeyguard = true;
+ if (attrs.type == TYPE_STATUS_BAR) {
+ if ((attrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0) {
+ mForceStatusBarFromKeyguard = true;
+ }
+ if ((attrs.privateFlags & PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT) != 0) {
+ mForceStatusBarTransparent = true;
+ }
}
boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW
@@ -4302,7 +4309,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (DEBUG_LAYOUT) Slog.i(TAG, "force=" + mForceStatusBar
+ " forcefkg=" + mForceStatusBarFromKeyguard
+ " top=" + mTopFullscreenOpaqueWindowState);
- if (mForceStatusBar || mForceStatusBarFromKeyguard) {
+ boolean shouldBeTransparent = mForceStatusBarTransparent
+ && !mForceStatusBar
+ && !mForceStatusBarFromKeyguard;
+ if (!shouldBeTransparent) {
+ mStatusBarController.setShowTransparent(false /* transparent */);
+ } else if (!mStatusBar.isVisibleLw()) {
+ mStatusBarController.setShowTransparent(true /* transparent */);
+ }
+ if (mForceStatusBar || mForceStatusBarFromKeyguard || mForceStatusBarTransparent) {
if (DEBUG_LAYOUT) Slog.v(TAG, "Showing status bar: forced");
if (mStatusBarController.setBarShowingLw(true)) {
changes |= FINISH_LAYOUT_REDO_LAYOUT;