summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java12
1 files changed, 8 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 8c23eaad5521..185dd0c8b4d8 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -8152,13 +8152,17 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
* into account orientation per-app overrides applied by the device manufacturers.
*/
@Override
+ @ActivityInfo.ScreenOrientation
protected int getOverrideOrientation() {
- if (mWmService.mConstants.mIgnoreActivityOrientationRequest
- && info.applicationInfo.category != ApplicationInfo.CATEGORY_GAME) {
- return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
+ final int candidateOrientation;
+ if (!mWmService.mConstants.mIgnoreActivityOrientationRequest
+ || info.applicationInfo.category == ApplicationInfo.CATEGORY_GAME) {
+ candidateOrientation = super.getOverrideOrientation();
+ } else {
+ candidateOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
return mAppCompatController.getOrientationPolicy()
- .overrideOrientationIfNeeded(super.getOverrideOrientation());
+ .overrideOrientationIfNeeded(candidateOrientation);
}
/**