Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +20 −5 Original line number Diff line number Diff line Loading @@ -631,8 +631,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mPointerLocationMode = 0; // guarded by mLock // The last window we were told about in focusChanged. // The windows we were told about in focusChanged. WindowState mFocusedWindow; WindowState mLastFocusedWindow; IApplicationToken mFocusedApp; PointerLocationView mPointerLocationView; Loading Loading @@ -3334,6 +3336,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { mNavigationBar = null; mNavigationBarController.setWindow(null); } if (mLastFocusedWindow == win) { mLastFocusedWindow = null; } mScreenDecorWindows.remove(win); } Loading Loading @@ -5879,6 +5884,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public int focusChangedLw(WindowState lastFocus, WindowState newFocus) { mFocusedWindow = newFocus; mLastFocusedWindow = lastFocus; if ((updateSystemUiVisibilityLw() & SYSTEM_UI_CHANGING_LAYOUT) != 0) { // If the navigation bar has been hidden or shown, we need to do another // layout pass to update that window. Loading Loading @@ -8105,10 +8111,19 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (winCandidate == null) { return 0; } // The immersive mode confirmation should never affect the system bar visibility, otherwise // it will unhide the navigation bar and hide itself. if (winCandidate.getAttrs().token == mImmersiveModeConfirmation.getWindowToken()) { // The immersive mode confirmation should never affect the system bar visibility, // otherwise it will unhide the navigation bar and hide itself. winCandidate = isStatusBarKeyguard() ? mStatusBar : mTopFullscreenOpaqueWindowState; // The immersive mode confirmation took the focus from mLastFocusedWindow which was // controlling the system ui visibility. So if mLastFocusedWindow can still receive // keys, we let it keep controlling the visibility. final boolean lastFocusCanReceiveKeys = (mLastFocusedWindow != null && mLastFocusedWindow.canReceiveKeys()); winCandidate = isStatusBarKeyguard() ? mStatusBar : lastFocusCanReceiveKeys ? mLastFocusedWindow : mTopFullscreenOpaqueWindowState; if (winCandidate == null) { return 0; } Loading services/core/java/com/android/server/policy/WindowManagerPolicy.java +3 −0 Original line number Diff line number Diff line Loading @@ -491,6 +491,9 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { */ boolean canAcquireSleepToken(); /** @return true if this window desires key events. */ boolean canReceiveKeys(); /** * Writes {@link com.android.server.wm.IdentifierProto} to stream. */ Loading services/core/java/com/android/server/wm/WindowState.java +2 −2 Original line number Diff line number Diff line Loading @@ -2493,8 +2493,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return getWindowConfiguration().keepVisibleDeadAppWindowOnScreen(); } /** @return true if this window desires key events. */ boolean canReceiveKeys() { @Override public boolean canReceiveKeys() { return isVisibleOrAdding() && (mViewVisibility == View.VISIBLE) && !mRemoveOnExit && ((mAttrs.flags & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) == 0) Loading services/tests/servicestests/src/com/android/server/policy/FakeWindowState.java +3 −0 Original line number Diff line number Diff line Loading @@ -254,6 +254,9 @@ public class FakeWindowState implements WindowManagerPolicy.WindowState { throw new UnsupportedOperationException("not implemented"); } @Override public boolean canReceiveKeys() { return false; } @Override public void writeIdentifierToProto(ProtoOutputStream proto, long fieldId){ throw new UnsupportedOperationException("not implemented"); Loading Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +20 −5 Original line number Diff line number Diff line Loading @@ -631,8 +631,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mPointerLocationMode = 0; // guarded by mLock // The last window we were told about in focusChanged. // The windows we were told about in focusChanged. WindowState mFocusedWindow; WindowState mLastFocusedWindow; IApplicationToken mFocusedApp; PointerLocationView mPointerLocationView; Loading Loading @@ -3334,6 +3336,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { mNavigationBar = null; mNavigationBarController.setWindow(null); } if (mLastFocusedWindow == win) { mLastFocusedWindow = null; } mScreenDecorWindows.remove(win); } Loading Loading @@ -5879,6 +5884,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public int focusChangedLw(WindowState lastFocus, WindowState newFocus) { mFocusedWindow = newFocus; mLastFocusedWindow = lastFocus; if ((updateSystemUiVisibilityLw() & SYSTEM_UI_CHANGING_LAYOUT) != 0) { // If the navigation bar has been hidden or shown, we need to do another // layout pass to update that window. Loading Loading @@ -8105,10 +8111,19 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (winCandidate == null) { return 0; } // The immersive mode confirmation should never affect the system bar visibility, otherwise // it will unhide the navigation bar and hide itself. if (winCandidate.getAttrs().token == mImmersiveModeConfirmation.getWindowToken()) { // The immersive mode confirmation should never affect the system bar visibility, // otherwise it will unhide the navigation bar and hide itself. winCandidate = isStatusBarKeyguard() ? mStatusBar : mTopFullscreenOpaqueWindowState; // The immersive mode confirmation took the focus from mLastFocusedWindow which was // controlling the system ui visibility. So if mLastFocusedWindow can still receive // keys, we let it keep controlling the visibility. final boolean lastFocusCanReceiveKeys = (mLastFocusedWindow != null && mLastFocusedWindow.canReceiveKeys()); winCandidate = isStatusBarKeyguard() ? mStatusBar : lastFocusCanReceiveKeys ? mLastFocusedWindow : mTopFullscreenOpaqueWindowState; if (winCandidate == null) { return 0; } Loading
services/core/java/com/android/server/policy/WindowManagerPolicy.java +3 −0 Original line number Diff line number Diff line Loading @@ -491,6 +491,9 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { */ boolean canAcquireSleepToken(); /** @return true if this window desires key events. */ boolean canReceiveKeys(); /** * Writes {@link com.android.server.wm.IdentifierProto} to stream. */ Loading
services/core/java/com/android/server/wm/WindowState.java +2 −2 Original line number Diff line number Diff line Loading @@ -2493,8 +2493,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return getWindowConfiguration().keepVisibleDeadAppWindowOnScreen(); } /** @return true if this window desires key events. */ boolean canReceiveKeys() { @Override public boolean canReceiveKeys() { return isVisibleOrAdding() && (mViewVisibility == View.VISIBLE) && !mRemoveOnExit && ((mAttrs.flags & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) == 0) Loading
services/tests/servicestests/src/com/android/server/policy/FakeWindowState.java +3 −0 Original line number Diff line number Diff line Loading @@ -254,6 +254,9 @@ public class FakeWindowState implements WindowManagerPolicy.WindowState { throw new UnsupportedOperationException("not implemented"); } @Override public boolean canReceiveKeys() { return false; } @Override public void writeIdentifierToProto(ProtoOutputStream proto, long fieldId){ throw new UnsupportedOperationException("not implemented"); Loading