android7.1 强制横屏

msm8953

1、logo部分讲log旋转90度在刷机到设备里面,不需要修改代码

2、开机动画横屏需要在kernel设备树添加旋转90度

qcom,mdss-dsi-panel-orientation = "90";

3、framework 横屏参考网上代码修改

diff --git a/base/core/res/res/values/config.xml b/base/core/res/res/values/config.xml
index 2b5d68c..803e2c9 100755
--- a/base/core/res/res/values/config.xml
+++ b/base/core/res/res/values/config.xml
@@ -625,7 +625,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. -->
@@ -680,7 +680,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">90</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/base/services/core/java/com/android/server/policy/PhoneWindowManager.java b/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 82e739b..235770f 100755
--- a/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -6864,7 +6864,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
         }

         if (mForceDefaultOrientation) {
-            return Surface.ROTATION_0;
+            return Surface.ROTATION_90;
         }

         synchronized (mLock) {
diff --git a/base/services/core/java/com/android/server/wm/WindowManagerService.java b/base/services/core/java/com/android/server/wm/WindowManagerService.java
index e7d5cc4..c72f5bd 100755
--- a/base/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/base/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -556,7 +556,7 @@ public class WindowManagerService extends IWindowManager.Stub
     /** All DisplayContents in the world, kept here */
     SparseArray<DisplayContent> mDisplayContents = new SparseArray<>(2);

-    int mRotation = 0;
+    int mRotation = 1;
     int mLastOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
     boolean mAltOrientation = false;

@@ -3878,6 +3878,7 @@ public class WindowManagerService extends IWindowManager.Stub
         long ident = Binder.clearCallingIdentity();
         try {
             int req = getOrientationLocked();
+       req =ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
             if (req != mLastOrientation) {
                 mLastOrientation = req;
                 //send a message to Policy indicating orientation change to take

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

猜你喜欢

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