frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java

1
2
3
4
5
6
7
8
9
10
11
12
public boolean updateRotationUncheckedLocked(boolean inTransaction) {
...

if (DEBUG_ORIENTATION) {
Slog.v(TAG_WM, "Selected orientation "
+ mLastOrientation + ", got rotation " + rotation
+ " which has " + (altOrientation ? "incompatible" : "compatible")
+ " metrics");
}

...
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* Add By e0040: Force show rotation .
* Test using adb shell setprop sys.rotation.LANDSCAPE 0/90/180/270
*/

switch (SystemProperties.getInt("sys.rotation.LANDSCAPE", 0)) {

case 0:
rotation = Surface.ROTATION_0;
break;

case 90:
rotation = Surface.ROTATION_90;
break;

case 180:
rotation = Surface.ROTATION_180;
break;

case 270:
rotation = Surface.ROTATION_270;
break;

default:
rotation = Surface.ROTATION_0;
};

Test

1
adb shell setprop sys.rotation.LANDSCAPE 0