Skip to content

Commit

Permalink
Mount internal sdcard when updating from os
Browse files Browse the repository at this point in the history
Change-Id: Ib924fe17aef856963e69d4e3768ac37ac0362fd9
  • Loading branch information
SubZero7748 authored and Gerrit Code Review committed Oct 4, 2016
1 parent 8e507d8 commit 368bd2a
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion recovery.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit 368bd2a

Please sign in to comment.