From 4baf641e7d96375eba3f9a3aff5400b9e3d28cd6 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Mon, 20 Sep 2010 13:09:57 -0700 Subject: [PATCH] recovery just takes a filename as an argument now (do not merge) Change-Id: I900cb3e7392c38b40f8c08ae5282cd5c05a4a009 --- core/java/android/os/RecoverySystem.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java index 5fea6fec453fb..e56e25774d0f0 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);