修改源文件:UsbDeviceManager.java
文件路径:Android/frameworks/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java
1)、打开UsbDeviceManager.java文件:
2)、修改如下内容:setEnabledFunctions(UsbManager.FUNCTION_MTP, false);
protected void finishBoot() {
if (mBootCompleted && mCurrentUsbFunctionsReceived && mSystemReady) {
if (mPendingBootBroadcast) {
updateUsbStateBroadcastIfNeeded(getAppliedFunctions(mCurrentFunctions));
mPendingBootBroadcast = false;
}
if (!mScreenLocked
&& mScreenUnl