summaryrefslogtreecommitdiffstats
path: root/adb_install.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2017-09-08 13:50:54 +0200
committerEthan Yonker <dees_troy@teamw.in>2017-09-08 14:14:59 +0200
commit8373cfe28cf1b5ad758faa1d502e21787c3665e4 (patch)
tree2f567c52cd6f89e1052481497d236b58d230b7e2 /adb_install.cpp
parentDO NOT MERGE Android 8.0 stuff (diff)
parentrelease-request-f4ecf242-5d1c-45e0-8c7c-ede48d1a9e82-for-git_oc-release-4111650 snap-temp-L02200000075283731 (diff)
downloadandroid_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.gz
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.bz2
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.lz
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.xz
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.zst
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.zip
Diffstat (limited to 'adb_install.cpp')
-rw-r--r--adb_install.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/adb_install.cpp b/adb_install.cpp
index 448d61746..771994cd9 100644
--- a/adb_install.cpp
+++ b/adb_install.cpp
@@ -28,6 +28,8 @@
#include "ui.h"
#include "cutils/properties.h"
+#include "install.h"
+#include "common.h"
#include "adb_install.h"
#include "minadbd/fuse_adb_provider.h"
#include "fuse_sideload.h"
@@ -37,10 +39,7 @@
#include "verifier.h"
#endif
-static RecoveryUI* ui = NULL;
-
-void
-set_usb_driver(bool enabled) {
+static void set_usb_driver(bool enabled) {
int fd = open("/sys/class/android_usb/android0/enable", O_WRONLY);
if (fd < 0) {
/* These error messages show when built in older Android branches (e.g. Gingerbread)
@@ -65,20 +64,18 @@ set_usb_driver(bool enabled) {
}
}
-static void
-stop_adbd() {
+static void stop_adbd() {
+ printf("Stopping adbd...\n");
property_set("ctl.stop", "adbd");
set_usb_driver(false);
}
-bool is_ro_debuggable() {
+static bool is_ro_debuggable() {
char value[PROPERTY_VALUE_MAX+1];
return (property_get("ro.debuggable", value, NULL) == 1 && value[0] == '1');
}
-void
-maybe_restart_adbd() {
- char value[PROPERTY_VALUE_MAX+1];
+static void maybe_restart_adbd() {
if (is_ro_debuggable()) {
printf("Restarting adbd...\n");
set_usb_driver(true);
@@ -96,6 +93,12 @@ apply_from_adb(const char* install_file, pid_t* child_pid) {
stop_adbd();
set_usb_driver(true);
/*
+int apply_from_adb(RecoveryUI* ui, bool* wipe_cache, const char* install_file) {
+ modified_flash = true;
+
+ stop_adbd(ui);
+ set_usb_driver(ui, true);
+
ui->Print("\n\nNow send the package you want to apply\n"
"to the device with \"adb sideload <filename>\"...\n");
*/