summaryrefslogtreecommitdiffstats
path: root/install/fuse_install.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-02-16 09:00:08 +0100
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-02-16 09:00:08 +0100
commitc063deca1488c9271a79910eeabc317150d7a0e2 (patch)
tree07c9a404d116c8b85dc820126296629779e82d4b /install/fuse_install.cpp
parentMerge "Enable different interface for fastboot for cf" am: 46a3704702 am: 65700df1fe am: 4aed1b7059 (diff)
parentMerge "Perform data wipe in recovery if ota package has powerwash set" am: 266a01b799 am: 01f1e6cd40 (diff)
downloadandroid_bootable_recovery-c063deca1488c9271a79910eeabc317150d7a0e2.tar
android_bootable_recovery-c063deca1488c9271a79910eeabc317150d7a0e2.tar.gz
android_bootable_recovery-c063deca1488c9271a79910eeabc317150d7a0e2.tar.bz2
android_bootable_recovery-c063deca1488c9271a79910eeabc317150d7a0e2.tar.lz
android_bootable_recovery-c063deca1488c9271a79910eeabc317150d7a0e2.tar.xz
android_bootable_recovery-c063deca1488c9271a79910eeabc317150d7a0e2.tar.zst
android_bootable_recovery-c063deca1488c9271a79910eeabc317150d7a0e2.zip
Diffstat (limited to 'install/fuse_install.cpp')
-rw-r--r--install/fuse_install.cpp9
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;
}