[RK3288 RK3399][Android10] Android->添加遥控器鼠标模式切换功能

测试平台

Platform: RK3288 RK3399
OS: Android10


问题说明:

        RK3288、RK3399-Android10 Table方案默认是不支持遥控鼠标模式切换功能的(Box方案是支持的),这样就导致如果部分功能遥控光标无法移动到指定位置(比如部分输入法键盘无法通过遥控输入)


解决方法

代码路径:frameworks/native/services/inputflinger/EventHub.cpp

--- a/services/inputflinger/EventHub.cpp
+++ b/services/inputflinger/EventHub.cpp
@@ -1300,7 +1300,7 @@ status_t EventHub::openDeviceLocked(const char* devicePath) {
         // for infrare simulate mouse.
         char targetProduct[PROPERTY_VALUE_MAX] = "";
         property_get("ro.target.product", targetProduct, "");
-        if (strcmp(targetProduct, "box") == 0) {
+        if (strcmp(targetProduct, "tablet") == 0) {
            device->classes |= INPUT_DEVICE_CLASS_KEYMOUSE;
         }
     }

代码路径:frameworks/native/services/inputflinger/InputReader.cpp

--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -2403,17 +2403,13 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t scanCode,
     property_set("sys.ID.mID",mID);
 
     if (down) {
-        if (keyCode == AKEYCODE_PROFILE_SWITCH) {
-              char targetProduct[PROPERTY_VALUE_MAX] = "";
-              property_get("ro.target.product", targetProduct, "");
-              if (strcmp(targetProduct, "box") == 0) {
-                 if (strcmp(mKeyMouseState, "on")==0) {
-                     property_set("sys.KeyMouse.mKeyMouseState", "off");
-                 } else if (strcmp(mKeyMouseState,"off")==0) {
-                           property_set("sys.KeyMouse.mKeyMouseState","on");
-                 }
-              }
-        }
+          if (keyCode == AKEYCODE_PROFILE_SWITCH) {
+                  if (strcmp(mKeyMouseState, "on")==0) {


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值