Class Overview
RecoverySystem contains methods for interacting with the Android
recovery system (the separate partition that can be used to install
system updates, wipe user data, etc.)
Summary
Nested Classes |
interface |
RecoverySystem.ProgressListener |
Interface definition for a callback to be invoked regularly as
verification proceeds. |
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Constructors
Public Methods
public
static
void
installPackage
(Context context, File packageFile)
Reboots the device in order to install the given update
package.
Requires the REBOOT
permission.
Parameters
context
| the Context to use |
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.
|
public
static
void
rebootWipeCache
(Context context)
Reboot into the recovery system to wipe the /cache partition.
public
static
void
rebootWipeUserData
(Context context)
Reboots the device and wipes the user data partition. This is
sometimes called a "factory reset", which is something of a
misnomer because the system partition is not restored to its
factory state.
Requires the REBOOT
permission.
Parameters
context
| the Context to use |
Throws
IOException
| if writing the recovery command file
fails, or if the reboot itself fails.
|
Verify the cryptographic signature of a system update package
before installing it. Note that the package is also verified
separately by the installer once the device is rebooted into
the recovery system. This function will return only if the
package was successfully verified; otherwise it will throw an
exception.
Verification of a package can take significant time, so this
function should not be called from a UI thread. Interrupting
the thread while this function is in progress will result in a
SecurityException being thrown (and the thread's interrupt flag
will be cleared).
Parameters
packageFile
| the package to be verified |
listener
| an object to receive periodic progress
updates as verification proceeds. May be null. |
deviceCertsZipFile
| the zip file of certificates whose
public keys we will accept. Verification succeeds if the
package is signed by the private key corresponding to any
public key in this file. May be null to use the system default
file (currently "/system/etc/security/otacerts.zip"). |