方法一:
修改ro.product.model的值,在build\tools\buildinfo.sh发现ro.product.name对应的宏的名称,此处为PRODUCT_MODEL
echo “ro.product.model=$PRODUCT_MODEL”
在device\mediateksample\tb8765ap1_bsp_1g\full_tb8765ap1_bsp_1g.mk文件中添加或修改该宏的定义,如:
PRODUCT_MODEL := M1
注:不能有空格
方法二:
--- a/mt8765/frameworks/base/media/java/android/mtp/MtpDatabase.java
+++ b/mt8765/frameworks/base/media/java/android/mtp/MtpDatabase.java
@@ -861,7 +861,10 @@ public class MtpDatabase implements AutoCloseable {
case MtpConstants.DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER:
case MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME:
// writable string properties kept in shared preferences
- String value = mDeviceProperties.getString(Integer.toString(property), "");
+ //String value = mDeviceProperties.getString(Integer.toString(property), "");
+ String value = "M1";//PTP,MTP盘符都从此处获取。
int length = value.length();
if (length > 255) {
length = 255;