summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java2
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index ca8afe1972e9..1e003da3bda1 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -8065,7 +8065,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
*/
@Override
int getOrientation(int candidate) {
- if (shouldIgnoreOrientationRequests()) {
+ if (finishing || shouldIgnoreOrientationRequests()) {
return SCREEN_ORIENTATION_UNSET;
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
index e88a00b93b03..f049b3398f42 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -2640,6 +2640,9 @@ public class ActivityRecordTests extends WindowTestsBase {
// Can specify orientation if the current orientation candidate is orientation behind.
assertEquals(SCREEN_ORIENTATION_LANDSCAPE,
activity.getOrientation(SCREEN_ORIENTATION_BEHIND));
+ activity.makeFinishingLocked();
+ assertEquals("Finishing activity must not report orientation",
+ SCREEN_ORIENTATION_UNSET, activity.getOrientation(SCREEN_ORIENTATION_BEHIND));
final ActivityRecord translucentActivity = new ActivityBuilder(mAtm)
.setActivityTheme(android.R.style.Theme_Translucent)