Loading services/core/java/com/android/server/wm/DisplayRotationCompatPolicy.java +34 −35 Original line number Diff line number Diff line Loading @@ -359,12 +359,6 @@ final class DisplayRotationCompatPolicy { CAMERA_OPENED_ROTATION_UPDATE_DELAY_MS); } private void updateOrientationWithWmLock() { synchronized (mWmService.mGlobalLock) { mDisplayContent.updateOrientation(); } } private void delayedUpdateOrientationWithWmLock( @NonNull String cameraId, @NonNull String packageName) { synchronized (this) { Loading @@ -375,18 +369,20 @@ final class DisplayRotationCompatPolicy { } mCameraIdPackageBiMap.put(packageName, cameraId); } synchronized (mWmService.mGlobalLock) { ActivityRecord topActivity = mDisplayContent.topRunningActivity( /* considerKeyguardState= */ true); if (topActivity == null || topActivity.getTask() == null) { return; } // Checking whether an activity in fullscreen rather than the task as this camera compat // treatment doesn't cover activity embedding. // Checking whether an activity in fullscreen rather than the task as this camera // compat treatment doesn't cover activity embedding. if (topActivity.getWindowingMode() == WINDOWING_MODE_FULLSCREEN) { if (topActivity.mLetterboxUiController.isOverrideOrientationOnlyForCameraEnabled()) { if (topActivity.mLetterboxUiController .isOverrideOrientationOnlyForCameraEnabled()) { topActivity.recomputeConfiguration(); } updateOrientationWithWmLock(); mDisplayContent.updateOrientation(); return; } // Checking that the whole app is in multi-window mode as we shouldn't show toast Loading @@ -396,6 +392,7 @@ final class DisplayRotationCompatPolicy { showToast(R.string.display_rotation_camera_compat_toast_in_split_screen); } } } @VisibleForTesting void showToast(@StringRes int stringRes) { Loading Loading @@ -441,18 +438,20 @@ final class DisplayRotationCompatPolicy { ProtoLog.v(WM_DEBUG_ORIENTATION, "Display id=%d is notified that Camera %s is closed, updating rotation.", mDisplayContent.mDisplayId, cameraId); synchronized (mWmService.mGlobalLock) { ActivityRecord topActivity = mDisplayContent.topRunningActivity( /* considerKeyguardState= */ true); if (topActivity == null // Checking whether an activity in fullscreen rather than the task as this camera // compat treatment doesn't cover activity embedding. // Checking whether an activity in fullscreen rather than the task as this // camera compat treatment doesn't cover activity embedding. || topActivity.getWindowingMode() != WINDOWING_MODE_FULLSCREEN) { return; } if (topActivity.mLetterboxUiController.isOverrideOrientationOnlyForCameraEnabled()) { topActivity.recomputeConfiguration(); } updateOrientationWithWmLock(); mDisplayContent.updateOrientation(); } } private boolean isActivityForCameraIdRefreshing(String cameraId) { Loading Loading
services/core/java/com/android/server/wm/DisplayRotationCompatPolicy.java +34 −35 Original line number Diff line number Diff line Loading @@ -359,12 +359,6 @@ final class DisplayRotationCompatPolicy { CAMERA_OPENED_ROTATION_UPDATE_DELAY_MS); } private void updateOrientationWithWmLock() { synchronized (mWmService.mGlobalLock) { mDisplayContent.updateOrientation(); } } private void delayedUpdateOrientationWithWmLock( @NonNull String cameraId, @NonNull String packageName) { synchronized (this) { Loading @@ -375,18 +369,20 @@ final class DisplayRotationCompatPolicy { } mCameraIdPackageBiMap.put(packageName, cameraId); } synchronized (mWmService.mGlobalLock) { ActivityRecord topActivity = mDisplayContent.topRunningActivity( /* considerKeyguardState= */ true); if (topActivity == null || topActivity.getTask() == null) { return; } // Checking whether an activity in fullscreen rather than the task as this camera compat // treatment doesn't cover activity embedding. // Checking whether an activity in fullscreen rather than the task as this camera // compat treatment doesn't cover activity embedding. if (topActivity.getWindowingMode() == WINDOWING_MODE_FULLSCREEN) { if (topActivity.mLetterboxUiController.isOverrideOrientationOnlyForCameraEnabled()) { if (topActivity.mLetterboxUiController .isOverrideOrientationOnlyForCameraEnabled()) { topActivity.recomputeConfiguration(); } updateOrientationWithWmLock(); mDisplayContent.updateOrientation(); return; } // Checking that the whole app is in multi-window mode as we shouldn't show toast Loading @@ -396,6 +392,7 @@ final class DisplayRotationCompatPolicy { showToast(R.string.display_rotation_camera_compat_toast_in_split_screen); } } } @VisibleForTesting void showToast(@StringRes int stringRes) { Loading Loading @@ -441,18 +438,20 @@ final class DisplayRotationCompatPolicy { ProtoLog.v(WM_DEBUG_ORIENTATION, "Display id=%d is notified that Camera %s is closed, updating rotation.", mDisplayContent.mDisplayId, cameraId); synchronized (mWmService.mGlobalLock) { ActivityRecord topActivity = mDisplayContent.topRunningActivity( /* considerKeyguardState= */ true); if (topActivity == null // Checking whether an activity in fullscreen rather than the task as this camera // compat treatment doesn't cover activity embedding. // Checking whether an activity in fullscreen rather than the task as this // camera compat treatment doesn't cover activity embedding. || topActivity.getWindowingMode() != WINDOWING_MODE_FULLSCREEN) { return; } if (topActivity.mLetterboxUiController.isOverrideOrientationOnlyForCameraEnabled()) { topActivity.recomputeConfiguration(); } updateOrientationWithWmLock(); mDisplayContent.updateOrientation(); } } private boolean isActivityForCameraIdRefreshing(String cameraId) { Loading