summaryrefslogtreecommitdiffstats
path: root/minadbd/minadbd_services.cpp
diff options
context:
space:
mode:
authorxunchang <xunchang@google.com>2019-04-17 23:43:58 +0200
committerxunchang <xunchang@google.com>2019-04-23 20:33:57 +0200
commit9c04eb46b7492033e4675bd303a8bb20548081b5 (patch)
tree71e18ed0da06f4e3c5548488d8ec91747b565ca4 /minadbd/minadbd_services.cpp
parentMerge "minadbd: Support rescue install and getprop commands." (diff)
downloadandroid_bootable_recovery-9c04eb46b7492033e4675bd303a8bb20548081b5.tar
android_bootable_recovery-9c04eb46b7492033e4675bd303a8bb20548081b5.tar.gz
android_bootable_recovery-9c04eb46b7492033e4675bd303a8bb20548081b5.tar.bz2
android_bootable_recovery-9c04eb46b7492033e4675bd303a8bb20548081b5.tar.lz
android_bootable_recovery-9c04eb46b7492033e4675bd303a8bb20548081b5.tar.xz
android_bootable_recovery-9c04eb46b7492033e4675bd303a8bb20548081b5.tar.zst
android_bootable_recovery-9c04eb46b7492033e4675bd303a8bb20548081b5.zip
Diffstat (limited to 'minadbd/minadbd_services.cpp')
-rw-r--r--minadbd/minadbd_services.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/minadbd/minadbd_services.cpp b/minadbd/minadbd_services.cpp
index 136392a64..f6aff71f8 100644
--- a/minadbd/minadbd_services.cpp
+++ b/minadbd/minadbd_services.cpp
@@ -50,6 +50,7 @@
static int minadbd_socket = -1;
static bool rescue_mode = false;
+static std::string sideload_mount_point = FUSE_SIDELOAD_HOST_MOUNTPOINT;
void SetMinadbdSocketFd(int socket_fd) {
minadbd_socket = socket_fd;
@@ -59,6 +60,10 @@ void SetMinadbdRescueMode(bool rescue) {
rescue_mode = rescue;
}
+void SetSideloadMountPoint(const std::string& path) {
+ sideload_mount_point = path;
+}
+
static bool WriteCommandToFd(MinadbdCommands cmd, int fd) {
char message[kMinadbdMessageSize];
memcpy(message, kMinadbdCommandPrefix, strlen(kMinadbdStatusPrefix));
@@ -109,7 +114,8 @@ static MinadbdErrorCode RunAdbFuseSideload(int sfd, const std::string& args,
}
auto adb_data_reader = std::make_unique<FuseAdbDataProvider>(sfd, file_size, block_size);
- if (int result = run_fuse_sideload(std::move(adb_data_reader)); result != 0) {
+ if (int result = run_fuse_sideload(std::move(adb_data_reader), sideload_mount_point.c_str());
+ result != 0) {
LOG(ERROR) << "Failed to start fuse";
return kMinadbdFuseStartError;
}