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/fuse_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/fuse_install.cpp')
-rw-r--r-- | install/fuse_install.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/install/fuse_install.cpp b/install/fuse_install.cpp index 143b5d3fb..197e1debb 100644 --- a/install/fuse_install.cpp +++ b/install/fuse_install.cpp @@ -146,10 +146,11 @@ static bool StartInstallPackageFuse(std::string_view path) { return run_fuse_sideload(std::move(fuse_data_provider)) == 0; } -InstallResult InstallWithFuseFromPath(std::string_view path, RecoveryUI* ui) { +InstallResult InstallWithFuseFromPath(std::string_view path, Device* device) { // We used to use fuse in a thread as opposed to a process. Since accessing // through fuse involves going from kernel to userspace to kernel, it leads // to deadlock when a page fault occurs. (Bug: 26313124) + auto ui = device->GetUI(); pid_t child; if ((child = fork()) == 0) { bool status = StartInstallPackageFuse(path); @@ -183,8 +184,8 @@ InstallResult InstallWithFuseFromPath(std::string_view path, RecoveryUI* ui) { 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 /* retry_count */, ui); + result = InstallPackage(package.get(), FUSE_SIDELOAD_HOST_PATHNAME, false, 0 /* retry_count */, + device); break; } @@ -226,7 +227,7 @@ InstallResult ApplyFromSdcard(Device* device) { ui->Print("\n-- Install %s ...\n", path.c_str()); SetSdcardUpdateBootloaderMessage(); - auto result = InstallWithFuseFromPath(path, ui); + auto result = InstallWithFuseFromPath(path, device); ensure_path_unmounted(SDCARD_ROOT); return result; } |