summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/ApplicationThreadNative.java
diff options
context:
space:
mode:
authorAdam Skory <skory@google.com>2013-08-05 19:23:41 -0700
committerAdam Skory <skory@google.com>2013-08-07 02:20:44 +0100
commitdfc7fd7818cda46b914c8a9d69d1ba00443ffe5b (patch)
treebb6f5ca2baf7b31d89725be061db4dc40aa2ca3d /core/java/android/app/ApplicationThreadNative.java
parent94fa8956b02f307912746d9ac87be7798dc3464e (diff)
downloadframeworks_base-dfc7fd7818cda46b914c8a9d69d1ba00443ffe5b.zip
frameworks_base-dfc7fd7818cda46b914c8a9d69d1ba00443ffe5b.tar.gz
frameworks_base-dfc7fd7818cda46b914c8a9d69d1ba00443ffe5b.tar.bz2
Extend assist context to foreground services
Add Service.onProvideAssistData(Bundle) which will be called on foreground Services that have the new attr in their manifest of provideAssistData = true; Rename private reference to e.g. "getTopActivityExtras" as "getAssistContextExtras" - do not rename the relevant permission, since it is already public. In ActivityManagerService, request extras both from the top activity and from any foreground services with the above attribute. Extend PendingActivityExtras as PendingAssistExtras with a list of Services from which extras are expected. Reduce the timeout to or reporting extras from 4 sec to just 500 ms. Bug: 9526331 Change-Id: Ia03b96e8189033a68ae9c514c8cea0199a19bce8
Diffstat (limited to 'core/java/android/app/ApplicationThreadNative.java')
-rw-r--r--core/java/android/app/ApplicationThreadNative.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index 6f18e84..df5b476 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -599,13 +599,14 @@ public abstract class ApplicationThreadNative extends Binder
return true;
}
- case REQUEST_ACTIVITY_EXTRAS_TRANSACTION:
+ case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder activityToken = data.readStrongBinder();
IBinder requestToken = data.readStrongBinder();
int requestType = data.readInt();
- requestActivityExtras(activityToken, requestToken, requestType);
+ int index = data.readInt();
+ requestAssistContextExtras(activityToken, requestToken, requestType, index);
reply.writeNoException();
return true;
}
@@ -1238,14 +1239,16 @@ class ApplicationThreadProxy implements IApplicationThread {
}
@Override
- public void requestActivityExtras(IBinder activityToken, IBinder requestToken, int requestType)
- throws RemoteException {
+ public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
+ int requestType, int index) throws RemoteException {
Parcel data = Parcel.obtain();
data.writeInterfaceToken(IApplicationThread.descriptor);
data.writeStrongBinder(activityToken);
data.writeStrongBinder(requestToken);
data.writeInt(requestType);
- mRemote.transact(REQUEST_ACTIVITY_EXTRAS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
+ data.writeInt(index);
+ mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, null,
+ IBinder.FLAG_ONEWAY);
data.recycle();
}