RK3288 android 7.1.2 USB触摸方向修改

diff --git a/frameworks/native/services/inputflinger/InputReader.cpp b/frameworks/native/services/inputflinger/InputReader.cpp
old mode 100644
new mode 100755
index fa81a10..5dcf5f7
--- a/frameworks/native/services/inputflinger/InputReader.cpp
+++ b/frameworks/native/services/inputflinger/InputReader.cpp
@@ -3500,7 +3500,27 @@ void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) {
     bool viewportChanged = mViewport != newViewport;
     if (viewportChanged) {
         mViewport = newViewport;
-
+                char buffer_orientation[PROP_VALUE_MAX];   
+                memset(buffer_orientation, 0, sizeof(buffer_orientation));
+                property_get("persist.sys.rotation.einit", buffer_orientation, "0");    
+                int cmpRet = atoi(buffer_orientation);        
+                ALOGI("persist.sys.rotation.einit~~~~~~~~~~~~~~ = %d",cmpRet);    
+                if (cmpRet == 0)    
+                {        
+                       mViewport.orientation = DISPLAY_ORIENTATION_0;
+                }  
+                else if(cmpRet == 1)    
+                {
+                       mViewport.orientation = DISPLAY_ORIENTATION_90;  
+                }
+                else if(cmpRet == 2)
+                {
+                       mViewport.orientation = DISPLAY_ORIENTATION_180;  
+                }
+                else if(cmpRet == 3)
+                {
+                       mViewport.orientation = DISPLAY_ORIENTATION_270;  
+                }
         if (mDeviceMode == DEVICE_MODE_DIRECT || mDeviceMode == DEVICE_MODE_POINTER) {
             // Convert rotated viewport to natural surface coordinates.
             int32_t naturalLogicalWidth, naturalLogicalHeight;



diff --git a/device/rockchip/rk3288/system.prop b/device/rockchip/rk3288/system.prop
index 2831458..eb319af 100755
--- a/device/rockchip/rk3288/system.prop
+++ b/device/rockchip/rk3288/system.prop
@@ -28,8 +28,7 @@ sys.wallpaper.rgb565=0
 sf.power.control=2073600
 sys.rkadb.root=0
 ro.sf.fakerotation=false
+ro.sf.hwrotation=90
 ro.rk.MassStorage=false
 ro.rk.systembar.voiceicon=true
 ro.rk.systembar.tabletUI=false
@@ -53,5 +52,4 @@ sys.hwc.device.extend=DSI
 ro.sys.rotation.sensor=false
 persist.sys.rotation.efull=true
 # 0-0  1-90 2-180 3-270
+persist.sys.rotation.einit=1
\ No newline at end of file

技术交流群: 微信号

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值