diff options
| author | 2019-07-30 10:24:26 -0700 | |
|---|---|---|
| committer | 2019-07-30 10:24:26 -0700 | |
| commit | 4d68b649791dfd495023b16624df01e03216427c (patch) | |
| tree | 96db079cfad5649b247f77783f08d03ed3d765c7 | |
| parent | a110b6b9604f8ed93096fd569e4c9223e7f66630 (diff) | |
| parent | 6e141ce1ed0e744bd9cb02a8fc6f988749fbed9c (diff) | |
Merge "Allow resume of parent activity that launches PiP" into qt-r1-dev am: 2c89115cb7 am: d820cc2e7c
am: 6e141ce1ed
Change-Id: Ib7d224724a5c2bdf3248fa118167d2a34815fe90
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowProcessController.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/WindowProcessController.java b/services/core/java/com/android/server/wm/WindowProcessController.java index f74e2c01699d..4a91dac27d7e 100644 --- a/services/core/java/com/android/server/wm/WindowProcessController.java +++ b/services/core/java/com/android/server/wm/WindowProcessController.java @@ -566,7 +566,8 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio * activities are allowed to be resumed per process. * @return {@code true} if the activity is allowed to be resumed by compatibility * restrictions, which the activity was the topmost visible activity in process or the app is - * targeting after Q. + * targeting after Q. Note that non-focusable activity, in picture-in-picture mode for instance, + * does not count as a topmost activity. */ boolean updateTopResumingActivityInProcessIfNeeded(@NonNull ActivityRecord activity) { if (mInfo.targetSdkVersion >= Q || mPreQTopResumedActivity == activity) { @@ -582,9 +583,13 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio boolean canUpdate = false; final ActivityDisplay topDisplay = mPreQTopResumedActivity != null ? mPreQTopResumedActivity.getDisplay() : null; - // Update the topmost activity if current top activity was not on any display or no - // longer visible. - if (topDisplay == null || !mPreQTopResumedActivity.visible) { + // Update the topmost activity if current top activity is + // - not on any display OR + // - no longer visible OR + // - not focusable (in PiP mode for instance) + if (topDisplay == null + || !mPreQTopResumedActivity.visible + || !mPreQTopResumedActivity.isFocusable()) { canUpdate = true; } |