40 次浏览
path: <source>/frameworks/base/core/res/res/values/config.xml
(1)将config_supportAutoRotation的参数改为false
<!-- edited by peng, true to false -->
<bool name="config_supportAutoRotation">false</bool>
(2)将config_lidOpenRotation的参数由-1改为90
<!-- edited by peng, -1 to 90 -->
<integer name="config_lidOpenRotation">90</integer>
path: <source>/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
(1)def_user_rotation的参数由0改为1
<!-- edited by peng, 0 to 1 -->
<integer name="def_user_rotation">1</integer>
path: <source>/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
(1)在default:
// For USER, UNSPECIFIED, NOSENSOR, SENSOR and FULL_SENSOR,
// just return the preferred orientation we already calculated.
中return Surface.ROTATION_0前加入如下代码
// add by peng
int orient = SystemProperties.getInt("persist.panel.orientation", 0);
if (orient == 90) {
return Surface.ROTATION_90;
}
path: <source>/device/fsl/imx8m/evk_8mm/system.prop
(1)在persist.sys.country=CN后加入如下代码
#added by peng
persist.panel.orientation=90