diff options
author | Tianjie Xu <xunchang@google.com> | 2019-03-29 22:23:49 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-03-29 22:23:49 +0100 |
commit | a232d9dccbf39856824ad783cc2d66812f581d95 (patch) | |
tree | 7bad452d0d5b0ae6eca9adf18c7bf8b8966a318f /install/adb_install.cpp | |
parent | Merge "Use flags = 0 to avoid fd closing for child updater process" (diff) | |
parent | Move install to separate module (diff) | |
download | android_bootable_recovery-a232d9dccbf39856824ad783cc2d66812f581d95.tar android_bootable_recovery-a232d9dccbf39856824ad783cc2d66812f581d95.tar.gz android_bootable_recovery-a232d9dccbf39856824ad783cc2d66812f581d95.tar.bz2 android_bootable_recovery-a232d9dccbf39856824ad783cc2d66812f581d95.tar.lz android_bootable_recovery-a232d9dccbf39856824ad783cc2d66812f581d95.tar.xz android_bootable_recovery-a232d9dccbf39856824ad783cc2d66812f581d95.tar.zst android_bootable_recovery-a232d9dccbf39856824ad783cc2d66812f581d95.zip |
Diffstat (limited to '')
-rw-r--r-- | install/adb_install.cpp (renamed from adb_install.cpp) | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/adb_install.cpp b/install/adb_install.cpp index 1d19fd3a1..5296ff608 100644 --- a/adb_install.cpp +++ b/install/adb_install.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "adb_install.h" +#include "install/adb_install.h" #include <errno.h> #include <fcntl.h> @@ -29,12 +29,16 @@ #include <android-base/logging.h> #include <android-base/properties.h> -#include "common.h" #include "fuse_sideload.h" -#include "install.h" +#include "install/install.h" #include "recovery_ui/ui.h" -int apply_from_adb(bool* wipe_cache) { +static bool SetUsbConfig(const std::string& state) { + android::base::SetProperty("sys.usb.config", state); + return android::base::WaitForProperty("sys.usb.state", state); +} + +int apply_from_adb(bool* wipe_cache, RecoveryUI* ui) { // Save the usb state to restore after the sideload operation. std::string usb_state = android::base::GetProperty("sys.usb.state", "none"); // Clean up state and stop adbd. @@ -85,7 +89,7 @@ int apply_from_adb(bool* wipe_cache) { break; } } - result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, false, 0); + result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, false, 0, ui); break; } |