展锐平台,在做Android12竖屏转横屏,发现一个问题,最近任务列表 点击菜单键,显示先竖屏退出后再次进入就显示横屏现象。不能直接显示横屏的效果。经过不断深入研究做如下修改:
修改路径 根目录/package/apps/Launcher3下
diff --git a/quickstep/AndroidManifest-launcher.xml b/quickstep/AndroidManifest-launcher.xml
old mode 100644
new mode 100755
diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
old mode 100644
new mode 100755
index 6038a22de8..674ce86b83
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -70,7 +70,7 @@ public class RecentsOrientedState implements
SharedPreferences.OnSharedPreferenceChangeListener {
private static final String TAG = "RecentsOrientedState";
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = true;
@@ -291,7 +300,7 @@ public class RecentsOrientedState implements
}
private void updateHomeRotationSetting() {
- boolean homeRotationEnabled = mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY, false);
+ boolean homeRotationEnabled = true;
setFlag(FLAG_HOME_ROTATION_ALLOWED_IN_PREFS, homeRotationEnabled);
SystemUiProxy.INSTANCE.get(mContext).setHomeRotationEnabled(homeRotationEnabled);
}
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 6a4f85f566..1018e96390 100755
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -285,7 +285,7 @@ public class SettingsActivity extends FragmentActivity
case ALLOW_ROTATION_PREFERENCE_KEY:
DeviceProfile deviceProfile = InvariantDeviceProfile.INSTANCE.get(
getContext()).getDeviceProfile(getContext());
- if (deviceProfile.isTablet) {
+ if (true) {
// Launcher supports rotation by default. No need to show this setting.
return false;
}
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java
old mode 100644
new mode 100755
index 38b62d466e..cb0e1670e6
--- a/src/com/android/launcher3/states/RotationHelper.java
+++ b/src/com/android/launcher3/states/RotationHelper.java
@@ -91,7 +92,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener,
private void setIgnoreAutoRotateSettings(boolean ignoreAutoRotateSettings) {
// On large devices we do not handle auto-rotate differently.
- mIgnoreAutoRotateSettings = ignoreAutoRotateSettings;
+ mIgnoreAutoRotateSettings = true;
if (!mIgnoreAutoRotateSettings) {
if (mSharedPrefs == null) {
mSharedPrefs = Utilities.getPrefs(mActivity);
修改后测试正常