diff options
| author | Dianne Hackborn <hackbod@google.com> | 2011-01-21 13:34:36 -0800 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2011-01-21 13:42:26 -0800 |
| commit | 4eba96bb314d8ff773ea33d6cb3179f25751ecce (patch) | |
| tree | cac35a94f631043414175614e8045bb5edb3612e /core/java/android/app/ActivityManagerNative.java | |
| parent | d8b9d7cd1b2327b02e41edcddf94e64d481419d1 (diff) | |
Fix issue #3377999: Activities need to be stopped when sleeping
This is a band-aid over the existing kludgy stopping mechanism
where the semantics of stop are different in the activity manager
than in the clients.
This change is intended to be as unobtrusive as possible, only
impacting the sleep case. I have a different change that
completely reworks how we stop activities to simply this all
a lot by unifying the semantics between the server and client.
However, it is too late in HC for such an extensive change. Later
I'll revert this one and put in the better solution.
Change-Id: Id77f2db1ec83469cdd888acb8fbc4679daa7766e
Diffstat (limited to 'core/java/android/app/ActivityManagerNative.java')
| -rw-r--r-- | core/java/android/app/ActivityManagerNative.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index 34788a5df4ca..c095c069918b 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -376,6 +376,14 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } + case ACTIVITY_SLEPT_TRANSACTION: { + data.enforceInterface(IActivityManager.descriptor); + IBinder token = data.readStrongBinder(); + activitySlept(token); + reply.writeNoException(); + return true; + } + case ACTIVITY_DESTROYED_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); IBinder token = data.readStrongBinder(); @@ -1719,6 +1727,17 @@ class ActivityManagerProxy implements IActivityManager data.recycle(); reply.recycle(); } + public void activitySlept(IBinder token) throws RemoteException + { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); + data.writeInterfaceToken(IActivityManager.descriptor); + data.writeStrongBinder(token); + mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); + reply.readException(); + data.recycle(); + reply.recycle(); + } public void activityDestroyed(IBinder token) throws RemoteException { Parcel data = Parcel.obtain(); |
