Pass user to InstantAppResolverService methods.
This change adds userHandle as a parameter for InstantAppResolverService.
onGetInstantAppResolveInfo() and onGetInstantAppIntentFilter(), so
that Instant Apps can be resolved correctly for secondary users.
Bug: 109674934
Bug: 111436542
Test: manual
Change-Id: I6fed43896d0010fda2f1e6068b6a692a20b359d4
diff --git a/services/core/java/com/android/server/pm/InstantAppResolverConnection.java b/services/core/java/com/android/server/pm/InstantAppResolverConnection.java
index 16b4368..c0e9f58 100644
--- a/services/core/java/com/android/server/pm/InstantAppResolverConnection.java
+++ b/services/core/java/com/android/server/pm/InstantAppResolverConnection.java
@@ -85,8 +85,8 @@
mBgHandler = BackgroundThread.getHandler();
}
- public final List<InstantAppResolveInfo> getInstantAppResolveInfoList(Intent sanitizedIntent,
- int hashPrefix[], String token) throws ConnectionException {
+ public List<InstantAppResolveInfo> getInstantAppResolveInfoList(Intent sanitizedIntent,
+ int[] hashPrefix, int userId, String token) throws ConnectionException {
throwIfCalledOnMainThread();
IInstantAppResolver target = null;
try {
@@ -99,7 +99,8 @@
}
try {
return mGetInstantAppResolveInfoCaller
- .getInstantAppResolveInfoList(target, sanitizedIntent, hashPrefix, token);
+ .getInstantAppResolveInfoList(target, sanitizedIntent, hashPrefix, userId,
+ token);
} catch (TimeoutException e) {
throw new ConnectionException(ConnectionException.FAILURE_CALL);
} catch (RemoteException ignore) {
@@ -112,7 +113,7 @@
return null;
}
- public final void getInstantAppIntentFilterList(Intent sanitizedIntent, int hashPrefix[],
+ public void getInstantAppIntentFilterList(Intent sanitizedIntent, int[] hashPrefix, int userId,
String token, PhaseTwoCallback callback, Handler callbackHandler, final long startTime)
throws ConnectionException {
final IRemoteCallback remoteCallback = new IRemoteCallback.Stub() {
@@ -126,7 +127,7 @@
};
try {
getRemoteInstanceLazy(token)
- .getInstantAppIntentFilterList(sanitizedIntent, hashPrefix, token,
+ .getInstantAppIntentFilterList(sanitizedIntent, hashPrefix, userId, token,
remoteCallback);
} catch (TimeoutException e) {
throw new ConnectionException(ConnectionException.FAILURE_BIND);
@@ -352,11 +353,11 @@
}
public List<InstantAppResolveInfo> getInstantAppResolveInfoList(
- IInstantAppResolver target, Intent sanitizedIntent, int hashPrefix[], String token)
- throws RemoteException, TimeoutException {
+ IInstantAppResolver target, Intent sanitizedIntent, int[] hashPrefix, int userId,
+ String token) throws RemoteException, TimeoutException {
final int sequence = onBeforeRemoteCall();
- target.getInstantAppResolveInfoList(sanitizedIntent, hashPrefix, token, sequence,
- mCallback);
+ target.getInstantAppResolveInfoList(sanitizedIntent, hashPrefix, userId, token,
+ sequence, mCallback);
return getResultTimed(sequence);
}
}