summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2017-02-15 03:36:16 +0100
committerEthan Yonker <dees_troy@teamw.in>2017-02-23 19:30:59 +0100
commit84830ce015b83546f5bc25149e06647f2f7b5180 (patch)
tree4bb30d599e3cf493f5a033257591e644550477a4
parentbuild: [FIXUP] Addendum for BusyBox get/setprop & API 24 vs 25 (diff)
downloadandroid_bootable_recovery-84830ce015b83546f5bc25149e06647f2f7b5180.tar
android_bootable_recovery-84830ce015b83546f5bc25149e06647f2f7b5180.tar.gz
android_bootable_recovery-84830ce015b83546f5bc25149e06647f2f7b5180.tar.bz2
android_bootable_recovery-84830ce015b83546f5bc25149e06647f2f7b5180.tar.lz
android_bootable_recovery-84830ce015b83546f5bc25149e06647f2f7b5180.tar.xz
android_bootable_recovery-84830ce015b83546f5bc25149e06647f2f7b5180.tar.zst
android_bootable_recovery-84830ce015b83546f5bc25149e06647f2f7b5180.zip
-rw-r--r--etc/init.recovery.usb.rc4
-rw-r--r--twrp.cpp3
2 files changed, 3 insertions, 4 deletions
diff --git a/etc/init.recovery.usb.rc b/etc/init.recovery.usb.rc
index 801973671..8ef20e0ec 100644
--- a/etc/init.recovery.usb.rc
+++ b/etc/init.recovery.usb.rc
@@ -1,9 +1,9 @@
on fs
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 18D1
- write /sys/class/android_usb/android0/idProduct 4EE2
+ write /sys/class/android_usb/android0/idProduct D001
write /sys/class/android_usb/android0/f_ffs/aliases adb
- write /sys/class/android_usb/android0/functions mtp,adb
+ write /sys/class/android_usb/android0/functions adb
write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
write /sys/class/android_usb/android0/iProduct ${ro.product.model}
write /sys/class/android_usb/android0/iSerial ${ro.serialno}
diff --git a/twrp.cpp b/twrp.cpp
index 88df452e7..f0e572cb0 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -315,6 +315,7 @@ int main(int argc, char **argv) {
property_get("mtp.crash_check", mtp_crash_check, "0");
if (strcmp(mtp_crash_check, "0") == 0) {
property_set("mtp.crash_check", "1");
+ property_set("sys.usb.config", "adb"); // At first boot, should be adb-only
if (DataManager::GetIntValue("tw_mtp_enabled") == 1 && ((DataManager::GetIntValue(TW_IS_ENCRYPTED) != 0 && DataManager::GetIntValue(TW_IS_DECRYPTED) != 0) || DataManager::GetIntValue(TW_IS_ENCRYPTED) == 0)) {
LOGINFO("Enabling MTP during startup\n");
if (!PartitionManager.Enable_MTP())
@@ -330,8 +331,6 @@ int main(int argc, char **argv) {
DataManager::SetValue("tw_mtp_enabled", 0);
PartitionManager.Disable_MTP();
}
-#else
- PartitionManager.Disable_MTP();
#endif
#ifndef TW_OEM_BUILD