imx8 竖屏实现 android8

diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5080366..1fdb167 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -697,7 +697,7 @@
          settings are omitted from the system UI.  In certain situations we may
          still use the accelerometer to determine the orientation, such as when
          docked if the dock is configured to enable the accelerometer. -->
-    <bool name="config_supportAutoRotation">true</bool>
+    <bool name="config_supportAutoRotation">false</bool>
 
     <!-- If true, the screen can be rotated via the accelerometer in all 4
          rotations as the default behavior. -->
@@ -752,7 +752,7 @@
 
     <!-- The number of degrees to rotate the display when the keyboard is open.
          A value of -1 means no change in orientation by default. -->
-    <integer name="config_lidOpenRotation">-1</integer>
+    <integer name="config_lidOpenRotation">0</integer>
 
     <!-- Indicate whether the lid state impacts the accessibility of
          the physical keyboard.  0 means it doesn't, 1 means it is accessible
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 5f4c994..1e996cd 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -215,6 +215,7 @@ import android.view.WindowManagerPolicy.PointerEventListener;
 import android.view.WindowManagerPolicy.ScreenOffListener;
 import android.view.animation.Animation;
 import android.view.inputmethod.InputMethodManagerInternal;
+import android.content.pm.ActivityInfo;
 
 import com.android.internal.R;
 import com.android.internal.app.IAssistScreenshotReceiver;
@@ -2581,7 +2582,9 @@ public class WindowManagerService extends IWindowManager.Stub
         long ident = Binder.clearCallingIdentity();
         try {
             final DisplayContent dc = mRoot.getDisplayContent(displayId);
-            final int req = dc.getOrientation();
+//            final int req = dc.getOrientation();
+            final int req = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;  
+
             if (req != dc.getLastOrientation()) {
                 dc.setLastOrientation(req);
                 //send a message to Policy indicating orientation change to take

发布了25 篇原创文章 · 获赞 0 · 访问量 1023

猜你喜欢

转载自blog.csdn.net/jlgcumt/article/details/103136946