Android 6.0 默认允许ADB

device/rockchip/rk312x/system.prop

ro.adb.secure =1

frameworks/base/packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java

public void onCreate(Bundle icicle)

--		//setupAlert();
		
++		try {
    
    
++            IBinder b = ServiceManager.getService(USB_SERVICE);
++	        IUsbManager service = IUsbManager.Stub.asInterface(b);
++			service.allowUsbDebugging(true, mKey);			
++        } catch (Exception e) {
    
    
++            Log.e(TAG, "Unable to notify Usb service", e);
++        }
++        finish();

猜你喜欢

转载自blog.csdn.net/qq_27494201/article/details/125291224