summaryrefslogtreecommitdiffstats
path: root/recovery_main.cpp
diff options
context:
space:
mode:
authorBill Rassieur <rassb@google.com>2019-04-02 20:26:46 +0200
committerBill Rassieur <rassb@google.com>2019-04-02 20:26:46 +0200
commit86de943dcc7b81567514273be718e57703cf075c (patch)
treee9f635bd39b426228247ae3cf528f17061a55629 /recovery_main.cpp
parentMerge master@5406228 into git_qt-dev-plus-aosp. (diff)
parentMerge changes Ibbe7084e,If584fc8a am: bb8f0fff17 am: effd4ca883 (diff)
downloadandroid_bootable_recovery-86de943dcc7b81567514273be718e57703cf075c.tar
android_bootable_recovery-86de943dcc7b81567514273be718e57703cf075c.tar.gz
android_bootable_recovery-86de943dcc7b81567514273be718e57703cf075c.tar.bz2
android_bootable_recovery-86de943dcc7b81567514273be718e57703cf075c.tar.lz
android_bootable_recovery-86de943dcc7b81567514273be718e57703cf075c.tar.xz
android_bootable_recovery-86de943dcc7b81567514273be718e57703cf075c.tar.zst
android_bootable_recovery-86de943dcc7b81567514273be718e57703cf075c.zip
Diffstat (limited to 'recovery_main.cpp')
-rw-r--r--recovery_main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 2f5a1845b..b41368d7b 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -53,12 +53,12 @@
#include "logging.h"
#include "minadbd/minadbd.h"
#include "otautil/paths.h"
+#include "otautil/roots.h"
#include "otautil/sysutil.h"
#include "recovery.h"
#include "recovery_ui/device.h"
#include "recovery_ui/stub_ui.h"
#include "recovery_ui/ui.h"
-#include "roots.h"
static constexpr const char* COMMAND_FILE = "/cache/recovery/command";
static constexpr const char* LOCALE_FILE = "/cache/recovery/last_locale";
@@ -178,6 +178,12 @@ static std::string load_locale_from_cache() {
return android::base::Trim(content);
}
+// Sets the usb config to 'state'.
+static bool SetUsbConfig(const std::string& state) {
+ android::base::SetProperty("sys.usb.config", state);
+ return android::base::WaitForProperty("sys.usb.state", state);
+}
+
static void ListenRecoverySocket(RecoveryUI* ui, std::atomic<Device::BuiltinAction>& action) {
android::base::unique_fd sock_fd(android_get_control_socket("recovery"));
if (sock_fd < 0) {