diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 64a7407056..01893e92b1 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -20,15 +20,12 @@ import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessib import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType; import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS; import static com.android.launcher3.touch.OverScroll.OVERSCROLL_DAMP_FACTOR; -import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import android.animation.LayoutTransition; import android.animation.TimeInterpolator; import android.annotation.SuppressLint; -import android.content.ContentResolver; import android.content.Context; import android.content.res.TypedArray; -import android.database.ContentObserver; import android.graphics.Canvas; import android.graphics.Rect; import android.os.Bundle; @@ -67,9 +64,6 @@ public abstract class PagedView extends ViewGrou private static final String TAG = "PagedView"; private static final boolean DEBUG = false; - public static boolean sFlagForcedRotation = false; - public static final String FIXED_ROTATION_TRANSFORM_SETTING_NAME = "fixed_rotation_transform"; - public static final int INVALID_PAGE = -1; protected static final ComputePageScrollsLogic SIMPLE_SCROLL_LOGIC = (v) -> v.getVisibility() != GONE; @@ -172,12 +166,11 @@ public abstract class PagedView extends ViewGrou * Initializes various states for this workspace. */ protected void init() { - Context context = getContext(); - mScroller = new OverScroller(context); + mScroller = new OverScroller(getContext()); setDefaultInterpolator(Interpolators.SCROLL); mCurrentPage = 0; - final ViewConfiguration configuration = ViewConfiguration.get(context); + final ViewConfiguration configuration = ViewConfiguration.get(getContext()); mTouchSlop = configuration.getScaledPagingTouchSlop(); mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); @@ -189,18 +182,6 @@ public abstract class PagedView extends ViewGrou if (Utilities.ATLEAST_OREO) { setDefaultFocusHighlightEnabled(false); } - - sFlagForcedRotation = Utilities.isFixedRotationTransformEnabled(context); - final ContentResolver resolver = context.getContentResolver(); - final ContentObserver observer = new ContentObserver(MAIN_EXECUTOR.getHandler()) { - @Override - public void onChange(boolean selfChange) { - sFlagForcedRotation = Utilities.isFixedRotationTransformEnabled(context); - } - }; - resolver.registerContentObserver(Settings.Global.getUriFor( - FIXED_ROTATION_TRANSFORM_SETTING_NAME), - false, observer); } protected void setDefaultInterpolator(Interpolator interpolator) { diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 571f745080..e0e4cc0ce4 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -17,7 +17,6 @@ package com.android.launcher3; import static com.android.launcher3.ItemInfoWithIcon.FLAG_ICON_BADGED; -import static com.android.launcher3.PagedView.FIXED_ROTATION_TRANSFORM_SETTING_NAME; import android.animation.ValueAnimator; import android.annotation.TargetApi; @@ -128,14 +127,6 @@ public final class Utilities { Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0; } - /** - * Checks whether the fixed_rotation_flag is enabled. - */ - public static boolean isFixedRotationTransformEnabled(Context context) { - return Settings.Global.getInt(context.getContentResolver(), - FIXED_ROTATION_TRANSFORM_SETTING_NAME, 0) != 0; - } - // An intent extra to indicate the horizontal scroll of the wallpaper. public static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET"; public static final String EXTRA_WALLPAPER_FLAVOR = "com.android.launcher3.WALLPAPER_FLAVOR"; diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java index 3a64f9aeb8..852928b416 100644 --- a/src/com/android/launcher3/states/RotationHelper.java +++ b/src/com/android/launcher3/states/RotationHelper.java @@ -17,7 +17,6 @@ package com.android.launcher3.states; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LOCKED; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; -import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static android.util.DisplayMetrics.DENSITY_DEVICE_STABLE; @@ -27,7 +26,6 @@ import android.content.res.Resources; import android.view.WindowManager; import com.android.launcher3.Launcher; -import com.android.launcher3.PagedView; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; @@ -184,9 +182,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { } final int activityFlags; - if (PagedView.sFlagForcedRotation) { - activityFlags = SCREEN_ORIENTATION_PORTRAIT; - } else if (mStateHandlerRequest != REQUEST_NONE) { + if (mStateHandlerRequest != REQUEST_NONE) { activityFlags = mStateHandlerRequest == REQUEST_LOCK ? SCREEN_ORIENTATION_LOCKED : SCREEN_ORIENTATION_UNSPECIFIED; } else if (mCurrentTransitionRequest != REQUEST_NONE) {