Merge "Fix issue #7966357: Super lights out mode vs. volume dialog"

This commit is contained in:
Dianne Hackborn
2013-01-09 18:44:32 -08:00
committed by Android (Google) Code Review
3 changed files with 29 additions and 1 deletions

View File

@@ -309,6 +309,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
lp.type = LayoutParams.TYPE_VOLUME_OVERLAY;
lp.width = LayoutParams.WRAP_CONTENT;
lp.height = LayoutParams.WRAP_CONTENT;
lp.privateFlags |= LayoutParams.PRIVATE_FLAG_FORCE_SHOW_NAV_BAR;
window.setAttributes(lp);
window.addFlags(LayoutParams.FLAG_NOT_FOCUSABLE | LayoutParams.FLAG_NOT_TOUCH_MODAL
| LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);

View File

@@ -945,6 +945,13 @@ public interface WindowManager extends ViewManager {
* {@hide} */
public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
/**
* Special flag for the volume overlay: force the window manager out of "hide nav bar"
* mode while the window is on screen.
*
* {@hide} */
public static final int PRIVATE_FLAG_FORCE_SHOW_NAV_BAR = 0x00000020;
/**
* Control flags that are private to the platform.
* @hide

View File

@@ -412,6 +412,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean mForceStatusBar;
boolean mForceStatusBarFromKeyguard;
boolean mHideLockScreen;
boolean mForcingShowNavBar;
int mForcingShowNavBarLayer;
// States of keyguard dismiss.
private static final int DISMISS_KEYGUARD_NONE = 0; // Keyguard not being dismissed.
@@ -2952,6 +2954,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mTopFullscreenOpaqueWindowState = null;
mForceStatusBar = false;
mForceStatusBarFromKeyguard = false;
mForcingShowNavBar = false;
mForcingShowNavBarLayer = -1;
mHideLockScreen = false;
mAllowLockscreenWhenOn = false;
@@ -2966,6 +2970,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
WindowManager.LayoutParams attrs) {
if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw="
+ win.isVisibleOrBehindKeyguardLw());
if (mTopFullscreenOpaqueWindowState == null && (win.getAttrs().privateFlags
&WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_SHOW_NAV_BAR) != 0) {
if (mForcingShowNavBarLayer < 0) {
mForcingShowNavBar = true;
mForcingShowNavBarLayer = win.getSurfaceLayer();
}
}
if (mTopFullscreenOpaqueWindowState == null &&
win.isVisibleOrBehindKeyguardLw() && !win.isGoneForLayoutLw()) {
if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
@@ -4494,9 +4505,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// will quickly lose focus once it correctly gets hidden.
return 0;
}
final int visibility = mFocusedWindow.getSystemUiVisibility()
int tmpVisibility = mFocusedWindow.getSystemUiVisibility()
& ~mResettingSystemUiFlags
& ~mForceClearedSystemUiFlags;
if (mForcingShowNavBar && mFocusedWindow.getSurfaceLayer() < mForcingShowNavBarLayer) {
tmpVisibility &= ~View.SYSTEM_UI_CLEARABLE_FLAGS;
}
final int visibility = tmpVisibility;
int diff = visibility ^ mLastSystemUiFlags;
final boolean needsMenu = mFocusedWindow.getNeedsMenuLw(mTopFullscreenOpaqueWindowState);
if (diff == 0 && mLastFocusNeedsMenu == needsMenu
@@ -4692,6 +4707,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
pw.print(prefix); pw.print("mTopFullscreenOpaqueWindowState=");
pw.println(mTopFullscreenOpaqueWindowState);
}
if (mForcingShowNavBar) {
pw.print(prefix); pw.print("mForcingShowNavBar=");
pw.println(mForcingShowNavBar); pw.print( "mForcingShowNavBarLayer=");
pw.println(mForcingShowNavBarLayer);
}
pw.print(prefix); pw.print("mTopIsFullscreen="); pw.print(mTopIsFullscreen);
pw.print(" mHideLockScreen="); pw.println(mHideLockScreen);
pw.print(prefix); pw.print("mForceStatusBar="); pw.print(mForceStatusBar);