summaryrefslogtreecommitdiffstats
path: root/minadbd
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2019-04-15 21:45:50 +0200
committerTao Bao <tbao@google.com>2019-04-26 21:21:38 +0200
commit178cdd4f5c6ae59d5aaae2614f22cd783eba60d8 (patch)
treebc196683e4994ca538ae0317719f264a828dcfb0 /minadbd
parentAllow entering rescue mode via recovery UI. (diff)
downloadandroid_bootable_recovery-178cdd4f5c6ae59d5aaae2614f22cd783eba60d8.tar
android_bootable_recovery-178cdd4f5c6ae59d5aaae2614f22cd783eba60d8.tar.gz
android_bootable_recovery-178cdd4f5c6ae59d5aaae2614f22cd783eba60d8.tar.bz2
android_bootable_recovery-178cdd4f5c6ae59d5aaae2614f22cd783eba60d8.tar.lz
android_bootable_recovery-178cdd4f5c6ae59d5aaae2614f22cd783eba60d8.tar.xz
android_bootable_recovery-178cdd4f5c6ae59d5aaae2614f22cd783eba60d8.tar.zst
android_bootable_recovery-178cdd4f5c6ae59d5aaae2614f22cd783eba60d8.zip
Diffstat (limited to 'minadbd')
-rw-r--r--minadbd/fuse_adb_provider.h15
-rw-r--r--minadbd/minadbd_services.cpp3
2 files changed, 8 insertions, 10 deletions
diff --git a/minadbd/fuse_adb_provider.h b/minadbd/fuse_adb_provider.h
index 3fb689bd4..24a463d9b 100644
--- a/minadbd/fuse_adb_provider.h
+++ b/minadbd/fuse_adb_provider.h
@@ -14,25 +14,24 @@
* limitations under the License.
*/
-#ifndef __FUSE_ADB_PROVIDER_H
-#define __FUSE_ADB_PROVIDER_H
+#pragma once
#include <stdint.h>
-#include "android-base/unique_fd.h"
-
#include "fuse_provider.h"
// This class reads data from adb server.
class FuseAdbDataProvider : public FuseDataProvider {
public:
- FuseAdbDataProvider(android::base::unique_fd&& fd, uint64_t file_size, uint32_t block_size)
- : FuseDataProvider(std::move(fd), file_size, block_size) {}
+ FuseAdbDataProvider(int fd, uint64_t file_size, uint32_t block_size)
+ : FuseDataProvider(file_size, block_size), fd_(fd) {}
bool ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size,
uint32_t start_block) const override;
void Close() override;
-};
-#endif
+ private:
+ // The underlying source to read data from (i.e. the one that talks to the host).
+ int fd_;
+};
diff --git a/minadbd/minadbd_services.cpp b/minadbd/minadbd_services.cpp
index f0bb70af1..eaf88ecc2 100644
--- a/minadbd/minadbd_services.cpp
+++ b/minadbd/minadbd_services.cpp
@@ -102,8 +102,7 @@ static void sideload_host_service(unique_fd sfd, const std::string& args) {
exit(kMinadbdSocketIOError);
}
- auto adb_data_reader =
- std::make_unique<FuseAdbDataProvider>(std::move(sfd), file_size, block_size);
+ 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) {
LOG(ERROR) << "Failed to start fuse";
exit(kMinadbdFuseStartError);