diff options
author | Kelvin Zhang <zhangkelvin@google.com> | 2022-02-15 03:38:06 +0100 |
---|---|---|
committer | Kelvin Zhang <zhangkelvin@google.com> | 2022-02-15 05:20:08 +0100 |
commit | a4208b5f90baf1326d372fd97ca39f06911d7165 (patch) | |
tree | c09fc07501c783790d68976ed15a6c824a8bc0a8 /install/adb_install.cpp | |
parent | Merge "minui: add hall sensor event" (diff) | |
download | android_bootable_recovery-a4208b5f90baf1326d372fd97ca39f06911d7165.tar android_bootable_recovery-a4208b5f90baf1326d372fd97ca39f06911d7165.tar.gz android_bootable_recovery-a4208b5f90baf1326d372fd97ca39f06911d7165.tar.bz2 android_bootable_recovery-a4208b5f90baf1326d372fd97ca39f06911d7165.tar.lz android_bootable_recovery-a4208b5f90baf1326d372fd97ca39f06911d7165.tar.xz android_bootable_recovery-a4208b5f90baf1326d372fd97ca39f06911d7165.tar.zst android_bootable_recovery-a4208b5f90baf1326d372fd97ca39f06911d7165.zip |
Diffstat (limited to 'install/adb_install.cpp')
-rw-r--r-- | install/adb_install.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/install/adb_install.cpp b/install/adb_install.cpp index ee79a32c0..5cba7b67c 100644 --- a/install/adb_install.cpp +++ b/install/adb_install.cpp @@ -90,11 +90,12 @@ static bool WriteStatusToFd(MinadbdCommandStatus status, int fd) { // Installs the package from FUSE. Returns the installation result and whether it should continue // waiting for new commands. -static auto AdbInstallPackageHandler(RecoveryUI* ui, InstallResult* result) { +static auto AdbInstallPackageHandler(Device* device, InstallResult* result) { // How long (in seconds) we wait for the package path to be ready. It doesn't need to be too long // because the minadbd service has already issued an install command. 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.) + auto ui = device->GetUI(); constexpr int ADB_INSTALL_TIMEOUT = 15; bool should_continue = true; *result = INSTALL_ERROR; @@ -114,7 +115,7 @@ static auto AdbInstallPackageHandler(RecoveryUI* ui, InstallResult* result) { auto package = Package::CreateFilePackage(FUSE_SIDELOAD_HOST_PATHNAME, std::bind(&RecoveryUI::SetProgress, ui, std::placeholders::_1)); - *result = InstallPackage(package.get(), FUSE_SIDELOAD_HOST_PATHNAME, false, 0, ui); + *result = InstallPackage(package.get(), FUSE_SIDELOAD_HOST_PATHNAME, false, 0, device); break; } @@ -348,7 +349,7 @@ InstallResult ApplyFromAdb(Device* device, bool rescue_mode, Device::BuiltinActi InstallResult install_result = INSTALL_ERROR; std::map<MinadbdCommand, CommandFunction> command_map{ - { MinadbdCommand::kInstall, std::bind(&AdbInstallPackageHandler, ui, &install_result) }, + { MinadbdCommand::kInstall, std::bind(&AdbInstallPackageHandler, device, &install_result) }, { MinadbdCommand::kRebootAndroid, std::bind(&AdbRebootHandler, MinadbdCommand::kRebootAndroid, &install_result, reboot_action) }, { MinadbdCommand::kRebootBootloader, |