Commit 789d06e5 authored by Sicheng Li's avatar Sicheng Li Committed by Commit Bot

Remove redundant code in ScreenOrientationProviderImpl

This CL removes fetching ScreenOrientationConstants.EXTRA_ORIENTATION
from the intent to compute the default orientation. The fetch is
redundant to
CustomTabOrientationController#mLockScreenOrientation and
ScreenOrientationProviderImpl#mDefaultOrientationOverrides

Bug: 812797, 989606
Change-Id: I25ec7ecbdf1a9ac9ac20132568a2cd5da5f12739
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2324445Reviewed-by: default avatarPeter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Reviewed-by: default avatarElla Ge <eirage@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Auto-Submit: Sicheng Li <scli@google.com>
Commit-Queue: Sicheng Li <scli@google.com>
Cr-Commit-Position: refs/heads/master@{#793265}
parent 73b8e2ee
......@@ -21,7 +21,6 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.content_public.browser.ScreenOrientationDelegate;
import org.chromium.content_public.browser.ScreenOrientationProvider;
import org.chromium.content_public.common.ScreenOrientationConstants;
import org.chromium.device.mojom.ScreenOrientationLockType;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.display.DisplayAndroid;
......@@ -152,14 +151,8 @@ public class ScreenOrientationProviderImpl
mDefaultWebOrientation = mDefaultOrientationOverrides.get(activity);
}
int defaultOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
// Activities opened from a shortcut may have EXTRA_ORIENTATION set. In
// which case, we want to use that as the default orientation.
int orientation = activity.getIntent().getIntExtra(
ScreenOrientationConstants.EXTRA_ORIENTATION, mDefaultWebOrientation);
defaultOrientation = getOrientationFromWebScreenOrientations(
(byte) orientation, window, activity);
int defaultOrientation =
getOrientationFromWebScreenOrientations(mDefaultWebOrientation, window, activity);
try {
if (defaultOrientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment