am eb4d5b25: Merge "recovery just takes a filename as an argument now (do not merge)" into gingerbread
Merge commit 'eb4d5b253733a699c16f0a50a8e8642ec49ed9ae' into gingerbread-plus-aosp * commit 'eb4d5b253733a699c16f0a50a8e8642ec49ed9ae': recovery just takes a filename as an argument now (do not merge)
This commit is contained in:
@@ -307,8 +307,10 @@ public class RecoverySystem {
|
|||||||
* Requires the {@link android.Manifest.permission#REBOOT} permission.
|
* Requires the {@link android.Manifest.permission#REBOOT} permission.
|
||||||
*
|
*
|
||||||
* @param context the Context to use
|
* @param context the Context to use
|
||||||
* @param packageFile the update package to install. Currently
|
* @param packageFile the update package to install. Must be on
|
||||||
* must be on the /cache or /data partitions.
|
* 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
|
* @throws IOException if writing the recovery command file
|
||||||
* fails, or if the reboot itself fails.
|
* fails, or if the reboot itself fails.
|
||||||
@@ -316,15 +318,6 @@ public class RecoverySystem {
|
|||||||
public static void installPackage(Context context, File packageFile)
|
public static void installPackage(Context context, File packageFile)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
String filename = packageFile.getCanonicalPath();
|
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 + " !!!");
|
Log.w(TAG, "!!! REBOOTING TO INSTALL " + filename + " !!!");
|
||||||
String arg = "--update_package=" + filename;
|
String arg = "--update_package=" + filename;
|
||||||
bootCommand(context, arg);
|
bootCommand(context, arg);
|
||||||
|
|||||||
Reference in New Issue
Block a user