android 如何修改USB连接PC时可移动磁盘的名称?
2013-03-27 21:20
746 查看
手机连接到PC时,可移动磁盘的名称,也就是volume label的修改
此只能修改内置的存储区
1. /system/vold/Fat.cpp, Fat.h
另外需增加多一个参数在此方法定义处
Fat::format(const char *fsPath, unsigned int numSectors, bool isInternalSd)
if (numSectors) {
char tmp[32];
snprintf(tmp, sizeof(tmp), "%u", numSectors);
const char *size = tmp;
args[7] = "-s";
args[8] = size;
args[9] = fsPath;
args[10] = NULL;
rc = logwrap(11, args, 1);
} else {
if (isInternalSd){
args[7] = "-L";
args[8] = "YOUR LABEL NAME"; // modify your label here
args[9] = fsPath;
args[10] = NULL;
rc = logwrap(11, args, 1);
} else{
args[7] = fsPath;
args[8] = NULL;
rc = logwrap(9, args, 1);
}
}
2. /system/vold/Volume.cpp
在调用处做相应的修改
Fat::format(devicePath, 0, IsEmmcStorage())
*** Fat::format() 此文件 VolumeManger.cpp 不需要修改
此只能修改内置的存储区
1. /system/vold/Fat.cpp, Fat.h
另外需增加多一个参数在此方法定义处
Fat::format(const char *fsPath, unsigned int numSectors, bool isInternalSd)
if (numSectors) {
char tmp[32];
snprintf(tmp, sizeof(tmp), "%u", numSectors);
const char *size = tmp;
args[7] = "-s";
args[8] = size;
args[9] = fsPath;
args[10] = NULL;
rc = logwrap(11, args, 1);
} else {
if (isInternalSd){
args[7] = "-L";
args[8] = "YOUR LABEL NAME"; // modify your label here
args[9] = fsPath;
args[10] = NULL;
rc = logwrap(11, args, 1);
} else{
args[7] = fsPath;
args[8] = NULL;
rc = logwrap(9, args, 1);
}
}
2. /system/vold/Volume.cpp
在调用处做相应的修改
Fat::format(devicePath, 0, IsEmmcStorage())
*** Fat::format() 此文件 VolumeManger.cpp 不需要修改
相关文章推荐
- Android【USB名称修改系列】第7项-如何修改PTP设备在PC上弹出的对话框的标题
- Android【USB名称修改系列】第2项-如何修改PTP在PC"我的电脑"中显示的label名称
- Android【USB名称修改系列】第3项-如何修改MTP在PC"我的电脑"中显示的label名称
- Android【USB名称修改系列】第13项-如何修改USB存储在PC"我的电脑"中显示的label名称
- Android【USB名称修改系列】第4项-如何修改BICR在PC"我的电脑"中显示的label名称
- Android【USB名称修改系列】第5项-如何修改MTP在PC设备管理器中制造商的名称
- Android【USB名称修改系列】第6项-如何修改手机在PC桌面右下角弹出的“MT65xx Android Phone”提示框
- Android【USB名称修改系列】第8项-如何修改mtp设备在设备管理器中的”Portable Devices”下的名称
- Android【USB名称修改系列】第9项-如何修改UMS在设备管理器中DiskDrive下的名称
- android usb host 模式下开发 usb 口被device 占用如何连接PC查看logcat
- Android【USB名称修改系列】第10项-如何修改设备管理器中设备名后的数字
- Android【USB名称修改系列】第11项-如何修改preloader阶段的vcom口在windows右下角的提示框的字符串显示
- Android【USB名称修改系列】第12项-如何修改MTP在windows弹出的自动播放提示框标题
- android usb host 模式下开发 usb 口被device 占用如何连接PC查看logcat
- Android设备选择内置光盘 连接PC时 名称的修改方式
- android--修改USB存储在PC"我的电脑"中显示的名称
- android 如何修改USB存储在"我的电脑"中显示的label名称
- Ubuntu下Android如何将手机通过USB连接PC开发测试
- Android【USB名称修改系列】第14项-如何修改pc端設備管理器中"Android Phone"目錄下的設備名
- android usb host 模式下开发 usb 口被device 占用如何连接PC查看logcat