add recovery system interface to API

Adds android.os.RecoverySystem (marked as pending) to replace the
(hidden) com.android.internal.os.RecoverySystem.  RecoverySystem
contains methods for:

  - verifying the signature of an update package
  - rebooting to install a package
  - rebooting to wipe user data

(The reboot functions require "android.permission.REBOOT" and
"android.permission.ACCESS_CACHE_FILESYSTEM".)  Providing these
simplifies implementation of OTA update for device builders.

Change-Id: I63ce743b156e7a1a0327fd395b0e4a82c0eda79a
This commit is contained in:
Doug Zongker
2010-01-05 11:28:55 -08:00
parent 3e7b44fade
commit 1af33d0ddc
4 changed files with 424 additions and 148 deletions

View File

@@ -21,11 +21,11 @@ import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.ICheckinService;
import android.os.IParentalControlCallback;
import android.os.RecoverySystem;
import android.util.Log;
import java.io.IOException;
import com.android.internal.os.RecoverySystem;
import com.google.android.net.ParentalControlState;
/**
@@ -50,7 +50,7 @@ public final class FallbackCheckinService extends ICheckinService.Stub {
// Save the android ID so the new system can get it erased.
try {
RecoverySystem.rebootAndWipe();
RecoverySystem.rebootWipeUserData(mContext);
} catch (IOException e) {
Log.e(TAG, "Reboot for masterClear() failed", e);
}
@@ -67,7 +67,7 @@ public final class FallbackCheckinService extends ICheckinService.Stub {
// Save the android ID so the new system can get it erased.
try {
RecoverySystem.rebootAndToggleEFS(efsEnabled);
RecoverySystem.rebootToggleEFS(mContext, efsEnabled);
} catch (IOException e) {
Log.e(TAG, "Reboot for toggle EFS failed", e);
}