Merge changes I4c369222,I8a8ad4b3 into android-4.4

* changes:
  Enable UMS mounting of storage drives
  Set listener properties for UMS mount/unmount
This commit is contained in:
Dees Troy
2014-01-21 15:58:42 +01:00
committed by Gerrit Code Review
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -41,6 +41,16 @@ on boot
on property:sys.powerctl=*
powerctl ${sys.powerctl}
on property:sys.storage.ums_enabled=1
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/functions adb,mass_storage
write /sys/class/android_usb/android0/enable 1
on property:sys.storage.ums_enabled=0
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/functions adb
write /sys/class/android_usb/android0/enable ${service.adb.root}
service ueventd /sbin/ueventd
critical
+2
View File
@@ -1519,6 +1519,7 @@ int TWPartitionManager::Open_Lun_File(string Partition_Path, string Lun_File) {
LOGERR("Unable to write to ums lunfile '%s': (%s)\n", Lun_File.c_str(), strerror(errno));
return false;
}
property_set("sys.storage.ums_enabled", "1");
return true;
}
@@ -1579,6 +1580,7 @@ int TWPartitionManager::usb_storage_disable(void) {
Mount_All_Storage();
Update_System_Details();
UnMount_Main_Partitions();
property_set("sys.storage.ums_enabled", "0");
if (ret < 0 && index == 0) {
LOGERR("Unable to write to ums lunfile '%s'.", lun_file);
return false;