Android MTK 6763 User 版本默認打開usb調試

1.xxxx\build\make\core\main.mk

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

 @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);
        }       
        }
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章