Loading services/core/java/com/android/server/wm/DisplayPolicy.java +2 −7 Original line number Diff line number Diff line Loading @@ -2128,15 +2128,10 @@ public class DisplayPolicy { } void updateSystemBarAttributes() { WindowState winCandidate = mFocusedWindow; if (winCandidate == null && mTopFullscreenOpaqueWindowState != null && (mTopFullscreenOpaqueWindowState.mAttrs.flags & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) == 0) { // Only focusable window can take system bar control. winCandidate = mTopFullscreenOpaqueWindowState; } // If there is no window focused, there will be nobody to handle the events // anyway, so just hang on in whatever state we're in until things settle down. WindowState winCandidate = mFocusedWindow != null ? mFocusedWindow : mTopFullscreenOpaqueWindowState; if (winCandidate == null) { return; } Loading services/core/java/com/android/server/wm/WindowState.java +4 −1 Original line number Diff line number Diff line Loading @@ -2090,7 +2090,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } else { final Task task = getTask(); final boolean canFromTask = task != null && task.canAffectSystemUiFlags(); return canFromTask && mActivityRecord.isVisible(); return canFromTask && mActivityRecord.isVisible() // Do not let snapshot window control the bar && (mAttrs.type != TYPE_APPLICATION_STARTING || !(mStartingData instanceof SnapshotStartingData)); } } Loading services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +10 −0 Original line number Diff line number Diff line Loading @@ -412,6 +412,16 @@ public class WindowStateTests extends WindowTestsBase { assertFalse(app.canAffectSystemUiFlags()); } @Test public void testCanAffectSystemUiFlags_starting() { final WindowState app = createWindow(null, TYPE_APPLICATION_STARTING, "app"); app.mActivityRecord.setVisible(true); app.mStartingData = new SnapshotStartingData(mWm, null, 0); assertFalse(app.canAffectSystemUiFlags()); app.mStartingData = new SplashScreenStartingData(mWm, 0, 0); assertTrue(app.canAffectSystemUiFlags()); } @Test public void testCanAffectSystemUiFlags_disallow() { final WindowState app = createWindow(null, TYPE_APPLICATION, "app"); Loading Loading
services/core/java/com/android/server/wm/DisplayPolicy.java +2 −7 Original line number Diff line number Diff line Loading @@ -2128,15 +2128,10 @@ public class DisplayPolicy { } void updateSystemBarAttributes() { WindowState winCandidate = mFocusedWindow; if (winCandidate == null && mTopFullscreenOpaqueWindowState != null && (mTopFullscreenOpaqueWindowState.mAttrs.flags & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) == 0) { // Only focusable window can take system bar control. winCandidate = mTopFullscreenOpaqueWindowState; } // If there is no window focused, there will be nobody to handle the events // anyway, so just hang on in whatever state we're in until things settle down. WindowState winCandidate = mFocusedWindow != null ? mFocusedWindow : mTopFullscreenOpaqueWindowState; if (winCandidate == null) { return; } Loading
services/core/java/com/android/server/wm/WindowState.java +4 −1 Original line number Diff line number Diff line Loading @@ -2090,7 +2090,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } else { final Task task = getTask(); final boolean canFromTask = task != null && task.canAffectSystemUiFlags(); return canFromTask && mActivityRecord.isVisible(); return canFromTask && mActivityRecord.isVisible() // Do not let snapshot window control the bar && (mAttrs.type != TYPE_APPLICATION_STARTING || !(mStartingData instanceof SnapshotStartingData)); } } Loading
services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +10 −0 Original line number Diff line number Diff line Loading @@ -412,6 +412,16 @@ public class WindowStateTests extends WindowTestsBase { assertFalse(app.canAffectSystemUiFlags()); } @Test public void testCanAffectSystemUiFlags_starting() { final WindowState app = createWindow(null, TYPE_APPLICATION_STARTING, "app"); app.mActivityRecord.setVisible(true); app.mStartingData = new SnapshotStartingData(mWm, null, 0); assertFalse(app.canAffectSystemUiFlags()); app.mStartingData = new SplashScreenStartingData(mWm, 0, 0); assertTrue(app.canAffectSystemUiFlags()); } @Test public void testCanAffectSystemUiFlags_disallow() { final WindowState app = createWindow(null, TYPE_APPLICATION, "app"); Loading