Merge "fix app prediction service doesn't clean-up properly." into rvc-qpr-dev am: 4cb7d8c878

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12221409

Change-Id: I880aa857e53bc499837b8cb2c1eeff84137a55be
This commit is contained in:
TreeHugger Robot
2020-08-24 18:57:50 +00:00
committed by Automerger Merge Worker
4 changed files with 92 additions and 56 deletions

View File

@@ -83,6 +83,8 @@ public final class AppPredictor {
private final AppPredictionSessionId mSessionId;
private final ArrayMap<Callback, CallbackWrapper> mRegisteredCallbacks = new ArrayMap<>();
private final IBinder mToken = new Binder();
/**
* Creates a new Prediction client.
* <p>
@@ -98,7 +100,7 @@ public final class AppPredictor {
mSessionId = new AppPredictionSessionId(
context.getPackageName() + ":" + UUID.randomUUID().toString(), context.getUserId());
try {
mPredictionManager.createPredictionSession(predictionContext, mSessionId);
mPredictionManager.createPredictionSession(predictionContext, mSessionId, mToken);
} catch (RemoteException e) {
Log.e(TAG, "Failed to create predictor", e);
e.rethrowAsRuntimeException();

View File

@@ -29,7 +29,7 @@ import android.content.pm.ParceledListSlice;
interface IPredictionManager {
void createPredictionSession(in AppPredictionContext context,
in AppPredictionSessionId sessionId);
in AppPredictionSessionId sessionId, in IBinder token);
void notifyAppTargetEvent(in AppPredictionSessionId sessionId, in AppTargetEvent event);