Recently there is a demand, that is, cell phone connection PC, in inhibits PTP mode, according to marketing of mobile phone, cell phone instead of showing the project name,
Refer to the FAQ but change is invalid, the blog also search some good articles can be modified, but will introduce some problems, so here I ask bosses:
1, modify frameworks/base/media/Java/android/MTP/MtpDatabase. Java [code=@ VisibleForNative
718 private int getDeviceProperty (int property, long [] outIntValue, char [] outStringValue) {
719 switch (property) {
720 case MtpConstants. DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER:
721 case MtpConstants. DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME:
722//writable string properties kept in Shared preferences
723 String value=https://bbs.csdn.net/topics/mDeviceProperties.getString (Integer. ToString (property), "");
You want to modify the value for name
724 int length=value. The length ();
725 the if (length & gt; 255) {
726 length=255;
727}
728 value. GetChars (0, length, outStringValue, 0);
729 outStringValue [length]=0; ] [/code]
This method is feasible, but will introduce some problems: if the first mobile phones will have changed with the computer displays the name of, want to be normal again the unmodified mobile phones with also can normal shows, there is a doubt have cache the function of the PC?
2, when the phone is connected to the PC, click inhibits PTP or MTP mode, computer screen at the bottom right corner will have a bullet box, and display the name of the "mobile phone", this string in what position change, please?
Modify the Alps/kernel/drivers/usb/gadget/Android. C, PRODUCT_STRING macro for the content of the corresponding name:
# define PRODUCT_STRING "MT65xx Android Phone", "
But can't find the corresponding on Android Q # define PRODUCT_STRING field
Excuse me, how the name of the modal window also can modify?
Here, thank you, every brother see