summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index eab1aaf0d9fb..c16b64946fef 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -2665,10 +2665,15 @@ 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;
}