summaryrefslogtreecommitdiffstats
path: root/install/adb_install.cpp
diff options
context:
space:
mode:
authorxunchang <xunchang@google.com>2019-03-23 00:08:52 +0100
committerxunchang <xunchang@google.com>2019-03-29 18:27:51 +0100
commit2478885f3ca47fe2c4073df1100f7bd6ad4931af (patch)
tree7bad452d0d5b0ae6eca9adf18c7bf8b8966a318f /install/adb_install.cpp
parentMerge "Use flags = 0 to avoid fd closing for child updater process" (diff)
downloadandroid_bootable_recovery-2478885f3ca47fe2c4073df1100f7bd6ad4931af.tar
android_bootable_recovery-2478885f3ca47fe2c4073df1100f7bd6ad4931af.tar.gz
android_bootable_recovery-2478885f3ca47fe2c4073df1100f7bd6ad4931af.tar.bz2
android_bootable_recovery-2478885f3ca47fe2c4073df1100f7bd6ad4931af.tar.lz
android_bootable_recovery-2478885f3ca47fe2c4073df1100f7bd6ad4931af.tar.xz
android_bootable_recovery-2478885f3ca47fe2c4073df1100f7bd6ad4931af.tar.zst
android_bootable_recovery-2478885f3ca47fe2c4073df1100f7bd6ad4931af.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;
}