summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/init.rc10
-rw-r--r--partitionmanager.cpp5
2 files changed, 13 insertions, 2 deletions
diff --git a/etc/init.rc b/etc/init.rc
index aeec483a3..8cff20ec6 100644
--- a/etc/init.rc
+++ b/etc/init.rc
@@ -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
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index da11e8dfe..a58900c6e 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1470,9 +1470,8 @@ int TWPartitionManager::Decrypt_Device(string Password) {
if (dat->Mount(false) && TWFunc::Path_Exists("/data/media/0")) {
dat->Storage_Path = "/data/media/0";
dat->Symlink_Path = dat->Storage_Path;
- DataManager::SetValue(TW_INTERNAL_PATH, "/data/media/0");
+ DataManager::SetValue("tw_storage_path", "/data/media/0");
dat->UnMount(false);
- DataManager::SetBackupFolder();
Output_Partition(dat);
}
#endif
@@ -1520,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;
}
@@ -1580,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;