diff options
| author | Tao Bao <tbao@google.com> | 2015-05-21 16:25:19 -0700 |
|---|---|---|
| committer | Tao Bao <tbao@google.com> | 2015-05-21 16:26:08 -0700 |
| commit | 90237f7beb55dae79cdcba5271f96be778573737 (patch) | |
| tree | 6edd8eded135a7fad6e81068c203f9b76657cb21 /core/java/android/os/RecoverySystem.java | |
| parent | beda8613ad7bc01affa17857faed04d9589db34c (diff) | |
Wait for uncrypt to finish before rebooting
/system/bin/uncrypt needs to be triggered to prepare the OTA package
before rebooting into the recovery. For larger packages, uncrypt may be
killed before it finishes the work after the timeout. Change to monitor
the uncrypt status and show the progress to user.
Needs matching changes in bootable/recovery/uncrypt, system/core and
external/sepolicy.
Bug: 20012567
Bug: 20949086
Change-Id: I2348a98312c4dae81f618b45a2ee3b4cf6246ff5
Diffstat (limited to 'core/java/android/os/RecoverySystem.java')
| -rw-r--r-- | core/java/android/os/RecoverySystem.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java index 4aeab49e971b..0c79094acdb1 100644 --- a/core/java/android/os/RecoverySystem.java +++ b/core/java/android/os/RecoverySystem.java @@ -71,6 +71,7 @@ public class RecoverySystem { /** Used to communicate with recovery. See bootable/recovery/recovery.c. */ private static File RECOVERY_DIR = new File("/cache/recovery"); private static File COMMAND_FILE = new File(RECOVERY_DIR, "command"); + private static File UNCRYPT_FILE = new File(RECOVERY_DIR, "uncrypt_file"); private static File LOG_FILE = new File(RECOVERY_DIR, "log"); private static String LAST_PREFIX = "last_"; @@ -333,8 +334,21 @@ public class RecoverySystem { public static void installPackage(Context context, File packageFile) throws IOException { String filename = packageFile.getCanonicalPath(); + + FileWriter uncryptFile = new FileWriter(UNCRYPT_FILE); + try { + uncryptFile.write(filename + "\n"); + } finally { + uncryptFile.close(); + } Log.w(TAG, "!!! REBOOTING TO INSTALL " + filename + " !!!"); + // If the package is on the /data partition, write the block map file + // into COMMAND_FILE instead. + if (filename.startsWith("/data/")) { + filename = "@/cache/recovery/block.map"; + } + final String filenameArg = "--update_package=" + filename; final String localeArg = "--locale=" + Locale.getDefault().toString(); bootCommand(context, filenameArg, localeArg); |
