1.xxxx\build\make\core\main.mk(User 版本默认打开usb调试)
endif # !user_variant
ifeq (true,$(strip $(enable_target_debugging)))
# Target is more debuggable and adbd is on by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
# Enable Dalvik lock contention logging.
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
# Include the debugging/testing OTA keys in this build.
INCLUDE_TEST_OTA_KEYS := true
else # !enable_target_debugging
# Target is less debuggable and adbd is off by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 ##0->1
endif # !enable_target_debugging
## eng ##
2.xxxx\vendor\mediatek\proprietary\packages\apps\SystemUI\src\com\android\systemui\usb\UsbDebuggingActivity.java(默认关闭adb认证)
@Override
public void onReceive(Context content, Intent intent) {
String action = intent.getAction();
if (!UsbManager.ACTION_USB_STATE.equals(action)) {
return;
}
// boolean connected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false);
boolean connected = false;
if (!connected) {
mActivity.finish();
}
try {
IBinder b = ServiceManager.getService(USB_SERVICE);
IUsbManager service = IUsbManager.Stub.asInterface(b);
service.allowUsbDebugging(true, mKey);
// service.clearUsbDebuggingKeys();
} catch (Exception e) {
Log.e(TAG, "Unable to notify Usb service", e);
}
}
}