diff options
| author | 2020-05-08 16:02:26 +0800 | |
|---|---|---|
| committer | 2020-05-10 22:08:18 +0800 | |
| commit | c3bf552ca8dc687bc088848af81fd6cbef31daf6 (patch) | |
| tree | b9d53e9651f4062810b93de00d1bb23e22e8e44c | |
| parent | 950aca5795537311f014fc39998172db42727e24 (diff) | |
Fix fillsParent() always be false on finishing activity
ActivityRecord#occludesParent() returns true only if the activity
is not finish and is opaque since 99d6f0e, which caused side-effects
to ActivityRecord#fillParent().
Bug: 155343623
Test: Close a freeform activity and examine the app transition
Change-Id: I30f7071e5dadade8dc0aa3a7c8a573bf72c81f72
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityRecord.java | 16 | ||||
| -rw-r--r-- | services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java | 1 |
2 files changed, 13 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index f05217c0b47a..8293769f2863 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -2115,12 +2115,20 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A @Override boolean fillsParent() { - return occludesParent(); + return occludesParent(true /* includingFinishing */); } - /** Returns true if this activity is opaque and fills the entire space of this task. */ + /** Returns true if this activity is not finishing, is opaque and fills the entire space of + * this task. */ boolean occludesParent() { - return !finishing && mOccludesParent; + return occludesParent(false /* includingFinishing */); + } + + private boolean occludesParent(boolean includingFinishing) { + if (!includingFinishing && finishing) { + return false; + } + return mOccludesParent; } boolean setOccludesParent(boolean occludesParent) { @@ -7539,7 +7547,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (mThumbnail != null){ mThumbnail.dumpDebug(proto, THUMBNAIL); } - proto.write(FILLS_PARENT, mOccludesParent); + proto.write(FILLS_PARENT, fillsParent()); proto.write(APP_STOPPED, mAppStopped); proto.write(TRANSLUCENT, !occludesParent()); proto.write(VISIBLE, mVisible); diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java index 466f1a9f7852..95732d721ebb 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java +++ b/services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java @@ -295,6 +295,7 @@ class ActivityTestsBase extends SystemServiceTestsBase { // fullscreen value is normally read from resources in ctor, so for testing we need // to set it somewhere else since we can't mock resources. doReturn(true).when(activity).occludesParent(); + doReturn(true).when(activity).fillsParent(); mTask.addChild(activity); // Make visible by default... activity.setVisible(true); |