aboutsummaryrefslogtreecommitdiffstats
path: root/adb_install.cpp
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2014-07-10 07:31:46 -0700
committerDoug Zongker <dougz@google.com>2014-07-10 10:55:07 -0700
commit18a78e0a162c35756628610307f41179816d3333 (patch)
tree0fc0d66dacdb35be53da27a80e77865f68dc8325 /adb_install.cpp
parent93950229cf9a991589f6bb071a966b00349d18d6 (diff)
downloadbootable_recovery-18a78e0a162c35756628610307f41179816d3333.tar.gz
bootable_recovery-18a78e0a162c35756628610307f41179816d3333.tar.bz2
bootable_recovery-18a78e0a162c35756628610307f41179816d3333.zip
refactor fuse sideloading code
Split the adb-specific portions (fetching a block from the adb host and closing the connections) out from the rest of the FUSE filesystem code, so that we can reuse the fuse stuff for installing off sdcards as well. Change-Id: I0ba385fd35999c5f5cad27842bc82024a264dd14
Diffstat (limited to 'adb_install.cpp')
-rw-r--r--adb_install.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/adb_install.cpp b/adb_install.cpp
index fb7860c..be3b9a0 100644
--- a/adb_install.cpp
+++ b/adb_install.cpp
@@ -31,7 +31,8 @@
#include "common.h"
#include "adb_install.h"
extern "C" {
-#include "minadbd/adb.h"
+#include "minadbd/fuse_adb_provider.h"
+#include "fuse_sideload.h"
}
static RecoveryUI* ui = NULL;
@@ -89,7 +90,7 @@ apply_from_adb(RecoveryUI* ui_, int* wipe_cache, const char* install_file) {
_exit(-1);
}
- // ADB_SIDELOAD_HOST_PATHNAME will start to exist once the host
+ // FUSE_SIDELOAD_HOST_PATHNAME will start to exist once the host
// connects and starts serving a package. Poll for its
// appearance. (Note that inotify doesn't work with FUSE.)
int result;
@@ -103,7 +104,7 @@ apply_from_adb(RecoveryUI* ui_, int* wipe_cache, const char* install_file) {
break;
}
- if (stat(ADB_SIDELOAD_HOST_PATHNAME, &st) != 0) {
+ if (stat(FUSE_SIDELOAD_HOST_PATHNAME, &st) != 0) {
if (errno == ENOENT && i < ADB_INSTALL_TIMEOUT-1) {
sleep(1);
continue;
@@ -114,14 +115,14 @@ apply_from_adb(RecoveryUI* ui_, int* wipe_cache, const char* install_file) {
break;
}
}
- result = install_package(ADB_SIDELOAD_HOST_PATHNAME, wipe_cache, install_file, false);
+ result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, install_file, false);
break;
}
if (!waited) {
// Calling stat() on this magic filename signals the minadbd
// subprocess to shut down.
- stat(ADB_SIDELOAD_HOST_EXIT_PATHNAME, &st);
+ stat(FUSE_SIDELOAD_HOST_EXIT_PATHNAME, &st);
// TODO(dougz): there should be a way to cancel waiting for a
// package (by pushing some button combo on the device). For now