Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog

The volume panel now forces us out of the UI modes while it
is up.

Change-Id: If39fa33b1c52579bf5d376ce4722408cee3ca951
This commit is contained in:
Dianne Hackborn
2013-01-09 18:31:37 -08:00
parent d29f2d263a
commit e62fa82579
4 changed files with 30 additions and 2 deletions

View File

@ -302,6 +302,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.
@ -2936,6 +2938,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mTopFullscreenOpaqueWindowState = null;
mForceStatusBar = false;
mForceStatusBarFromKeyguard = false;
mForcingShowNavBar = false;
mForcingShowNavBarLayer = -1;
mHideLockScreen = false;
mAllowLockscreenWhenOn = false;
@ -2950,6 +2954,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) {
@ -4478,9 +4489,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
@ -4667,6 +4682,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);

View File

@ -3869,7 +3869,7 @@ public final class ActivityManagerService extends ActivityManagerNative
}
boolean didSomething = killPackageProcessesLocked(name, appId, userId,
-100, callerWillRestart, false, doit, evenPersistent,
-100, callerWillRestart, true, doit, evenPersistent,
name == null ? ("force stop user " + userId) : ("force stop " + name));
TaskRecord lastTask = null;