首页 > 编程知识 正文

usb接口,如何将手机充电模式改为MTP

时间:2023-05-03 23:22:39 阅读:41063 作者:2547

将USB的默认选项更改为MTP文件传输。 修改文件为frameworks/base/services/USB/Java/com/Android/server/USB/USB设备管理器. Java。

. @ overridepublicvoidhandlemessage (消息msg ) switch ) msg.what ) case msg _ update _ state 3360 mconnected=) MSE msg 更新用户通告(false; 更新数据库通告(false; 集成电路(mbootcompleted ) (更新用户总线连接评估功能); } if ((mcurrentfunctionsusbmanager.function _ accessory )!=0) {更新数据中心访问sory (; (if ) mbootcompleted ) if (! 已连接! has消息(msg _ accessory _ mode _ enter _ time out )! has messages (msg _ function _ switch _ time out )/restoredefaultswhenusbisdisconnectedif (! mscreenlockedmscreenunlockedfunctions!=USB manager.function _ none (setscreenunlockedfunctions ); } else//2021 10 24 felixmamodifyusbdefaultvalue//setenabled functions (USB manager.function _ none,false ); 已启用功能(USB manager.function _ MTP,false ); } } updateUsbFunctions (; } else { mpendingbootbroadcast=true; } break; }protectedvoidfinishboot((if ) mbootcompletedmcurrentusbfunctionsreceivedmsystemready (if ) mpendingbootbroadcast ) )是(if (! mscreenlockedmscreenunlockedfunctions!=USB manager.function _ none (setscreenunlockedfunctions ); } else//2021 10 24 felixmamodifyusbdefaultvalue//setenabled functions (USB manager.function _ none,false ); 已启用功能(USB manager.function _ MTP,false ); (if ) mcurrentaccessory!=null (musbdevicemanager.getcurrentsettings ().accessoryattached ) mcurrentaccessory ); }更新用户通告(假); 更新数据库通告(false; updateUsbFunctions (; } .

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。