From 4f128e4d968b376bb7c3fa209d27b0a30202e604 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Tue, 10 May 2016 11:44:12 -0700 Subject: Fix multi-window assiststructure trashing When multiple activities within the same process try to handle requests for AssistStructure, the singleton mLastAssistStructure tends to trash the old structure when a second window's request comes in. This change passes in a sessionId so that the cache is only cleared if the session id changes. Bug: 28348867 Change-Id: I07efcd933db7e48aefd25a1c95493b71bbcffe4b --- core/java/android/app/ApplicationThreadNative.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/java/android/app/ApplicationThreadNative.java') diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index ea86dd0558d6..d6da3f44f4a0 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -621,7 +621,8 @@ public abstract class ApplicationThreadNative extends Binder IBinder activityToken = data.readStrongBinder(); IBinder requestToken = data.readStrongBinder(); int requestType = data.readInt(); - requestAssistContextExtras(activityToken, requestToken, requestType); + int sessionId = data.readInt(); + requestAssistContextExtras(activityToken, requestToken, requestType, sessionId); reply.writeNoException(); return true; } @@ -1377,12 +1378,13 @@ class ApplicationThreadProxy implements IApplicationThread { @Override public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken, - int requestType) throws RemoteException { + int requestType, int sessionId) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(activityToken); data.writeStrongBinder(requestToken); data.writeInt(requestType); + data.writeInt(sessionId); mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); -- cgit v1.2.3