diff options
author | Kay Arnesen <subzero7748@gmail.com> | 2016-06-06 22:16:14 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-10-03 19:34:37 -0700 |
commit | 368bd2abab25c637a657d1fe4cef6b2222b29e82 (patch) | |
tree | 61995204bf47d355c88db7f8cd638e6a64683865 | |
parent | 8e507d8e0f11076a40a46235cf5a13fc90bb3bb8 (diff) | |
download | bootable_recovery-368bd2abab25c637a657d1fe4cef6b2222b29e82.zip bootable_recovery-368bd2abab25c637a657d1fe4cef6b2222b29e82.tar.gz bootable_recovery-368bd2abab25c637a657d1fe4cef6b2222b29e82.tar.bz2 |
Mount internal sdcard when updating from os
Change-Id: Ib924fe17aef856963e69d4e3768ac37ac0362fd9
-rw-r--r-- | recovery.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/recovery.cpp b/recovery.cpp index 03425dc..0b59d12 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -1473,7 +1473,29 @@ main(int argc, char **argv) { } else #endif if (update_package != NULL) { - status = install_package(update_package, &should_wipe_cache, TEMPORARY_INSTALL_FILE, true); + std::vector<VolumeInfo> volumes = vdc->getVolumes(); + std::vector<VolumeInfo>::iterator vitr; + + for (vitr = volumes.begin(); vitr != volumes.end(); ++vitr) { + vdc->volumeMount(vitr->mId); + } + + void* token = start_sdcard_fuse(update_package); + + for (vitr = volumes.begin(); vitr != volumes.end(); ++vitr) { + vdc->volumeUnmount(vitr->mId, true); + } + + // check for sdcard path or normal path + if (token != NULL) { + status = install_package(FUSE_SIDELOAD_HOST_PATHNAME, &should_wipe_cache, + TEMPORARY_INSTALL_FILE, false); + finish_sdcard_fuse(token); + } else { + status = install_package(update_package, &should_wipe_cache, + TEMPORARY_INSTALL_FILE, true); + } + if (status == INSTALL_SUCCESS && should_wipe_cache) { wipe_cache(false, device); } |