diff options
author | Vadim Tryshev <vadimt@google.com> | 2018-09-21 14:31:21 -0700 |
---|---|---|
committer | Vadim Tryshev <vadimt@google.com> | 2018-09-21 14:53:11 -0700 |
commit | 802a28946c43f4f3e4d314838d019fdf6573f2fa (patch) | |
tree | 7f2a992743984387b0297b7c62bff4efc048a44a /src | |
parent | e583a064fadb17ca1a3630654651c7ff1a008f6d (diff) | |
download | android_packages_apps_Trebuchet-802a28946c43f4f3e4d314838d019fdf6573f2fa.tar.gz android_packages_apps_Trebuchet-802a28946c43f4f3e4d314838d019fdf6573f2fa.tar.bz2 android_packages_apps_Trebuchet-802a28946c43f4f3e4d314838d019fdf6573f2fa.zip |
Add support for testing in portrait mode
Bug: 110103162
Test: TaplTests
Change-Id: I7f633405c04984ea8f04acdc6dd4ad21019d3409
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 11 | ||||
-rw-r--r-- | src/com/android/launcher3/states/RotationHelper.java | 9 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 55074f813..151c76183 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -867,17 +867,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, } } - public boolean hasSettings() { - if (mLauncherCallbacks != null) { - return mLauncherCallbacks.hasSettings(); - } else { - // On O and above we there is always some setting present settings (add icon to - // home screen or icon badging). On earlier APIs we will have the allow rotation - // setting, on devices with a locked orientation, - return Utilities.ATLEAST_OREO || !getResources().getBoolean(R.bool.allow_rotation); - } - } - public boolean isInState(LauncherState state) { return mStateManager.getState() == state; } diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java index e8664458d..9c4a4eaa4 100644 --- a/src/com/android/launcher3/states/RotationHelper.java +++ b/src/com/android/launcher3/states/RotationHelper.java @@ -56,7 +56,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { private final Activity mActivity; private final SharedPreferences mPrefs; - private final boolean mIgnoreAutoRotateSettings; + private boolean mIgnoreAutoRotateSettings; private boolean mAutoRotateEnabled; /** @@ -110,6 +110,13 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { } } + // Used by tests only. + public void forceAllowRotationForTesting(boolean allowRotation) { + mIgnoreAutoRotateSettings = + allowRotation || mActivity.getResources().getBoolean(R.bool.allow_rotation); + notifyChange(); + } + public void initialize() { if (!mInitialized) { mInitialized = true; |