[RK3288][Android6.0] 调试笔记 --- 设置系统默认显示为竖屏

时间:2022-12-28 23:26:08

Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92

kris@:~/rk3288/device/rockchip/rk3288$ g df
diff --git a/system.prop b/system.prop
index f407b0f..2e2aaf5 100644
--- a/system.prop
+++ b/system.prop
@@ -56,3 +56,6 @@ persist.sys.country=CN

 #Kris, 170405, support to restore apks after wipe data.
 persist.benebot.restore=1
+
+persist.display.portrait=true

调用处:
WindowManagerService.java

public boolean updateRotationUncheckedLocked(boolean inTransaction) {
    if("true".equals(SystemProperties.get("persist.display.portrait","false"))){
         rotation = Surface.ROTATION_90;
    }
}