diff options
| author | Doug Zongker <dougz@android.com> | 2010-09-20 13:09:57 -0700 |
|---|---|---|
| committer | Doug Zongker <dougz@android.com> | 2010-09-21 12:33:25 -0700 |
| commit | c2f8a45876efb5ffe601bba28d6694d349736dbb (patch) | |
| tree | b629e92bf38c00a41b318f892dbb9a43fb620acf /core/java/android/os/RecoverySystem.java | |
| parent | 6f1e9618e40f9290d9d21a9b1e09e51dba53faed (diff) | |
recovery just takes a filename as an argument now
(Cherrypicked from gingerbread.)
Change-Id: I0deb8494465e1036280ac92730e537fd3f38a9fb
Diffstat (limited to 'core/java/android/os/RecoverySystem.java')
| -rw-r--r-- | core/java/android/os/RecoverySystem.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java index 5fea6fec453f..e56e25774d0f 100644 --- a/core/java/android/os/RecoverySystem.java +++ b/core/java/android/os/RecoverySystem.java @@ -307,8 +307,10 @@ public class RecoverySystem { * Requires the {@link android.Manifest.permission#REBOOT} permission. * * @param context the Context to use - * @param packageFile the update package to install. Currently - * must be on the /cache or /data partitions. + * @param packageFile the update package to install. Must be on + * a partition mountable by recovery. (The set of partitions + * known to recovery may vary from device to device. Generally, + * /cache and /data are safe.) * * @throws IOException if writing the recovery command file * fails, or if the reboot itself fails. @@ -316,15 +318,6 @@ public class RecoverySystem { public static void installPackage(Context context, File packageFile) throws IOException { String filename = packageFile.getCanonicalPath(); - - if (filename.startsWith("/cache/")) { - filename = "CACHE:" + filename.substring(7); - } else if (filename.startsWith("/data/")) { - filename = "DATA:" + filename.substring(6); - } else { - throw new IllegalArgumentException( - "Must start with /cache or /data: " + filename); - } Log.w(TAG, "!!! REBOOTING TO INSTALL " + filename + " !!!"); String arg = "--update_package=" + filename; bootCommand(context, arg); |
