1. 程式人生 > >[RK3288][Android6.0] 除錯筆記 --- 螢幕顯示旋轉方法

[RK3288][Android6.0] 除錯筆記 --- 螢幕顯示旋轉方法

Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92

顯示模組提供了一個property供修改旋轉方向,名為”ro.sf.hwrotation”,有四個值可選

Surface.java

/**
 * Rotation constant: 0 degree rotation (natural orientation)
 */
public static final int ROTATION_0 = 0;

/**
 * Rotation constant: 90 degree rotation.
 */
public static final int ROTATION_90 = 1
; /** * Rotation constant: 180 degree rotation. */ public static final int ROTATION_180 = 2; /** * Rotation constant: 270 degree rotation. */ public static final int ROTATION_270 = 3;

“ro.sf.hwrotation”相對於上一篇文章[RK3288][Android6.0] 除錯筆記 — 設定系統預設顯示為豎屏提到的”persist.display.portrait”更靈活
至於這兩個區別,我的理解是:
“persist.display.portrait”是在WindowManagerService控制的,比較偏上層
“ro.sf.hwrotation”是在Display模組控制,前者的控制最終還是要和後者疊加起來一起得出最終值吧

另外,改動只針對開機動畫(Android字型)之後的顯示有效,u-boot以及kernel logo不會受影響