vendor/mediatek/proprietary/packages/apps/Launcher3/res/
xml$launcher_preferences.xml
<SwitchPreference
android:key="pref_allowRotation"
android:title="@string/allow_rotation_title"
android:summary="@string/allow_rotation_desc"
android:defaultValue="@bool/allow_rotation"
android:persistent="true" />
allow_rotation = true
android:defaultValue="true"
packages/apps/Launcher3/src/com/android/launcher3/states/RotationHelper.java
public static boolean getAllowRotationDefaultValue(DeviceProfile deviceProfile) {
// If the device's pixel density was scaled (usually via settings for A11y), use the
// original dimensions to determine if rotation is allowed of not.
//*/ def open home screen rotate.
return true;
/*/
float originalSmallestWidth = dpiFromPx(
Math.min(deviceProfile.widthPx, deviceProfile.heightPx), DENSITY_DEVICE_STABLE);
return originalSmallestWidth >= MIN_TABLET_WIDTH;
//*/
}
===========================================================
packages/apps/Launcher3/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
private void updateHomeRotationSetting() {
//*/ device support home screen rotate.
boolean homeRotationEnabled = true;
/*/
boolean homeRotationEnabled = mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY, false);
//*/
setFlag(FLAG_HOME_ROTATION_ALLOWED_IN_PREFS, homeRotationEnabled);
SystemUiProxy.INSTANCE.get(mContext).setHomeRotationEnabled(homeRotationEnabled);
}
private void initFlags() {
setFlag(FLAG_ROTATION_WATCHER_SUPPORTED, mOrientationListener.canDetectOrientation());
// initialize external flags
updateAutoRotateSetting();
updateHomeRotationSetting();
}