Android系统下如何允许奥比中光3D传感摄像头USB设备访问

Android 4.4中允许奥比中光3D传感摄像头USB设备访问修改如下:

frameworks/base/services/java/com/android/server/usb/UsbSettingsManager.java

 

  public booleanhasPermission(UsbDevice device) {

          synchronized (mLock) {

               int uid = Binder.getCallingUid();

               if (uid == Process.SYSTEM_UID) {

                   return true;

               }

               //红色部分为添加内容

              if(device.getVendorId()==0x2bc5){

                     return true;

                 }

               ... ...

               return uidList.get(uid);

          }

      }

 

Android5.1中修改与4.4一样,文件路径不同。添加红色部分即可:

frameworks/base/services/usb/java/com/android/server/usb/UsbSettingsManager.java

public boolean hasPermission(UsbDevicedevice) {

       synchronized (mLock) {

           int uid = Binder.getCallingUid();

           if (uid == Process.SYSTEM_UID || mDisablePermissionDialogs) {

                return true;

           }

             

            if(device.getVendorId()==0x2bc5){

                     return true;

             }

           ... ...

           return uidList.get(uid);

       }

    }

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页