首先主板没有gsensor,通过两种方法去解决:
一、在AndroidManifest.xml:里面修改,这种方法需要对每个apk修改不方便。
由:AndroidManifest.xml: android:screenOrientation="portrait">
改为:AndroidManifest.xml: android:screenOrientation="landscape">
二、在idh.code\frameworks\base\policy\src\com\android\internal\policy\impl\PhoneWindowManager.java修改
public int rotationForOrientationLw(int orientation, int lastRotation) {
if (false) {
Slog.v(TAG, "rotationForOrientationLw(orient="
+ orientation + ", last=" + lastRotation
+ "); user=" + mUserRotation + " "
+ ((mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED)
? "USER_ROTATION_LOCKED" : "")
);
}
//zxw add start for 3