diff options
| -rw-r--r-- | cmds/installd/otapreopt.cpp | 4 | ||||
| -rw-r--r-- | cmds/installd/otapreopt_script.sh | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp index 6a3120c1b7..bf2c0d1023 100644 --- a/cmds/installd/otapreopt.cpp +++ b/cmds/installd/otapreopt.cpp @@ -308,7 +308,7 @@ private: // This is different from the normal installd. We only do the base // directory, the rest will be created on demand when each app is compiled. if (access(GetOtaDirectoryPrefix().c_str(), R_OK) < 0) { - LOG(ERROR) << "Could not access " << GetOtaDirectoryPrefix(); + PLOG(ERROR) << "Could not access " << GetOtaDirectoryPrefix(); return false; } @@ -460,7 +460,7 @@ private: // this tool will wipe the OTA artifact cache and try again (for robustness after // a failed OTA with remaining cache artifacts). if (access(apk_path, F_OK) != 0) { - LOG(WARNING) << "Skipping A/B OTA preopt of non-existing package " << apk_path; + PLOG(WARNING) << "Skipping A/B OTA preopt of non-existing package " << apk_path; return true; } diff --git a/cmds/installd/otapreopt_script.sh b/cmds/installd/otapreopt_script.sh index f950276090..db5c34edc2 100644 --- a/cmds/installd/otapreopt_script.sh +++ b/cmds/installd/otapreopt_script.sh @@ -60,6 +60,11 @@ print -u${STATUS_FD} "global_progress $PROGRESS" i=0 while ((i<MAXIMUM_PACKAGES)) ; do + DONE=$(cmd otadexopt done) + if [ "$DONE" = "OTA complete." ] ; then + break + fi + DEXOPT_PARAMS=$(cmd otadexopt next) /system/bin/otapreopt_chroot $STATUS_FD $TARGET_SLOT_SUFFIX $DEXOPT_PARAMS >&- 2>&- @@ -67,13 +72,8 @@ while ((i<MAXIMUM_PACKAGES)) ; do PROGRESS=$(cmd otadexopt progress) print -u${STATUS_FD} "global_progress $PROGRESS" - DONE=$(cmd otadexopt done) - if [ "$DONE" = "OTA incomplete." ] ; then - sleep 1 - i=$((i+1)) - continue - fi - break + sleep 1 + i=$((i+1)) done DONE=$(cmd otadexopt done) |