summaryrefslogtreecommitdiffstats
path: root/recovery_main.cpp
diff options
context:
space:
mode:
authorHongguang Chen <hgchen@google.com>2020-04-22 05:58:04 +0200
committerHongguang Chen <hgchen@google.com>2020-05-19 21:11:13 +0200
commit4d0df88d88db381422ee912f2609258d72eca4cf (patch)
tree959cfb41f4a1a056fc8d08f6f301e43ca3e9e9da /recovery_main.cpp
parentMerge changes from topic "nonab_on_vab_r" into rvc-dev (diff)
downloadandroid_bootable_recovery-4d0df88d88db381422ee912f2609258d72eca4cf.tar
android_bootable_recovery-4d0df88d88db381422ee912f2609258d72eca4cf.tar.gz
android_bootable_recovery-4d0df88d88db381422ee912f2609258d72eca4cf.tar.bz2
android_bootable_recovery-4d0df88d88db381422ee912f2609258d72eca4cf.tar.lz
android_bootable_recovery-4d0df88d88db381422ee912f2609258d72eca4cf.tar.xz
android_bootable_recovery-4d0df88d88db381422ee912f2609258d72eca4cf.tar.zst
android_bootable_recovery-4d0df88d88db381422ee912f2609258d72eca4cf.zip
Diffstat (limited to '')
-rw-r--r--recovery_main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 30a1fc0a4..80cba61d3 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -471,6 +471,11 @@ int main(int argc, char** argv) {
std::string usb_config =
fastboot ? "fastboot" : IsRoDebuggable() || IsDeviceUnlocked() ? "adb" : "none";
std::string usb_state = android::base::GetProperty("sys.usb.state", "none");
+ if (fastboot) {
+ device->PreFastboot();
+ } else {
+ device->PreRecovery();
+ }
if (usb_config != usb_state) {
if (!SetUsbConfig("none")) {
LOG(ERROR) << "Failed to clear USB config";