diff options
| author | 2020-06-15 22:42:02 +0000 | |
|---|---|---|
| committer | 2020-06-15 22:42:02 +0000 | |
| commit | 466a3e5bfa4af6afba432fe4a1e5e3dc2bbdfcab (patch) | |
| tree | 1e77c7be1e4c52509933f8eb0416357058959846 | |
| parent | c5304b1a61777019234e450542de9820399d5509 (diff) | |
| parent | b38e5406b00ad178f3ccf3fcf29881c4fd8960a4 (diff) | |
Merge "PIP window cant be ime target." into rvc-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityRecord.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 597fa949f4bf..5668454b7bb6 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -2198,10 +2198,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A @Override boolean isFocusable() { + return super.isFocusable() && (canReceiveKeys() || isAlwaysFocusable()); + } + + boolean canReceiveKeys() { // TODO(156521483): Propagate the state down the hierarchy instead of checking the parent - boolean canReceiveKeys = getWindowConfiguration().canReceiveKeys() - && getTask().getWindowConfiguration().canReceiveKeys(); - return super.isFocusable() && (canReceiveKeys || isAlwaysFocusable()); + return getWindowConfiguration().canReceiveKeys() + && (task == null || task.getWindowConfiguration().canReceiveKeys()); } boolean isResizeable() { @@ -2370,10 +2373,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // For the apps below Q, there can be only one app which has the focused window per // process, because legacy apps may not be ready for a multi-focus system. return false; + } } - return (getWindowConfiguration().canReceiveKeys() || isAlwaysFocusable()) - && getDisplay() != null; + return (canReceiveKeys() || isAlwaysFocusable()) && getDisplay() != null; } /** |