安卓14 禁用usb键盘鼠标

diff --git a/services/inputflinger/reader/EventHub.cpp b/services/inputflinger/reader/EventHub.cpp
index f08c9a37fe..b11d34fd58 100644
--- a/services/inputflinger/reader/EventHub.cpp
+++ b/services/inputflinger/reader/EventHub.cpp
@@ -2154,6 +2154,10 @@ void EventHub::openDeviceLocked(const std::string& devicePath) {
     // is possible that the same input event node (for example, /dev/input/event3) will be noticed
     // in both 'inotify' callback and also in the 'scanDirLocked' pass. To prevent duplicate devices
     // from getting registered, ensure that this path is not already covered by an existing device.
+    
+
+    // 
+
     for (const auto& [deviceId, device] : mDevices) {
         if (device->path == devicePath) {
             return; // device was already registered
@@ -2179,6 +2183,14 @@ void EventHub::openDeviceLocked(const std::string& devicePath) {
         buffer[sizeof(buffer) - 1] = '\0';
         identifier.name = buffer;
     }
+	ALOGE("liujunjie ===================== device:   %s  name:%s ===,%d==",devicePath.c_str(),identifier.name.c_str(),strcmp(identifier.name.c_str(),"SIGMACHIP Usb Mouse") == 0);
+	// liujunjie ADD 
+	if(strcmp(identifier.name.c_str(),"CASUE USB KB Consumer Control") == 0  ||  strcmp(identifier.name.c_str(),"SIGMACHIP Usb Mouse") == 0 || strcmp(identifier.name.c_str(),"CASUE USB KB" ) == 0){
+		ALOGE("liujunjie ======= retrun ============== device:   %s  name:%s =====",devicePath.c_str(),identifier.name.c_str());
+		close(fd);
+		return;
+	}
+	// liujunjie add end 
 
     // Check to see if the device is on our excluded list
     for (size_t i = 0; i < mExcludedDevices.size(); i++) {

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值