diff options
4 files changed, 30 insertions, 2 deletions
diff --git a/core/java/android/view/VolumePanel.java b/core/java/android/view/VolumePanel.java index d7c7f46..001d020 100644 --- a/core/java/android/view/VolumePanel.java +++ b/core/java/android/view/VolumePanel.java @@ -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); diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 3b31ff6..6a67d8b 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -946,6 +946,13 @@ public interface WindowManager extends ViewManager { 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 */ diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 242fb97..fb515ac 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -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); diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 49dc220..1d08d31 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -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; |