summaryrefslogtreecommitdiff
path: root/core/java/android/app/ApplicationThreadNative.java
diff options
context:
space:
mode:
authorChristopher Tate <ctate@android.com>2009-09-01 20:32:49 -0700
committerChristopher Tate <ctate@android.com>2009-09-01 20:59:36 -0700
commit5e1ab335e6e8fbfa19c64d53880a22f472010953 (patch)
tree4da429b3833ff29256d23f9e2e7f1b3a41715b65 /core/java/android/app/ApplicationThreadNative.java
parentc937b5ce4ff2f39fd9c60f718f98550a932b62f0 (diff)
Expand apps' control over the settings restore process
Applications can now specify two more aspects of the restore process: whether they need to run with their own custom Application subclass rather than being launched in the usual restricted mode during restore, and whether it's okay for the backup manager to kill the app process once restore has completed. The new manifest attributes for these are, respectively, android:restoreNeedsApplication and android:killAfterRestore. If unspecified in the manifest, restoreNeedsApplication is false, and killAfterRestore is true. In order to support kill-after-restore cleanly, this change also adds a new system-process-only interface to the Activity Manager, which will schedule a "commit suicide" event on the target app's main thread looper. The framework backup agents have been given the appropriate new backup attributes as well.
Diffstat (limited to 'core/java/android/app/ApplicationThreadNative.java')
-rw-r--r--core/java/android/app/ApplicationThreadNative.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index 15bf9edffccf..928981d0c2d6 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -258,6 +258,13 @@ public abstract class ApplicationThreadNative extends Binder
return true;
}
+ case SCHEDULE_SUICIDE_TRANSACTION:
+ {
+ data.enforceInterface(IApplicationThread.descriptor);
+ scheduleSuicide();
+ return true;
+ }
+
case REQUEST_THUMBNAIL_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
@@ -652,7 +659,15 @@ class ApplicationThreadProxy implements IApplicationThread {
IBinder.FLAG_ONEWAY);
data.recycle();
}
-
+
+ public final void scheduleSuicide() throws RemoteException {
+ Parcel data = Parcel.obtain();
+ data.writeInterfaceToken(IApplicationThread.descriptor);
+ mRemote.transact(SCHEDULE_SUICIDE_TRANSACTION, data, null,
+ IBinder.FLAG_ONEWAY);
+ data.recycle();
+ }
+
public final void requestThumbnail(IBinder token)
throws RemoteException {
Parcel data = Parcel.obtain();