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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值