diff options
author | 2021-10-27 11:25:12 -0700 | |
---|---|---|
committer | 2021-10-27 11:25:12 -0700 | |
commit | 50af435b775bdf61f10fbd99ffd4ace86ecb7619 (patch) | |
tree | 275e6e728e089582c1f105a266027a381c310f93 | |
parent | 7da5998d0300753d82a1a370edc01b5c4577d2d3 (diff) |
Send registerPredictionUpdates request immediately instead of pushing it to the main thread Looper queue.
This ensure requestPredictionUpdate executing after registerPredictionUpdates; otherwise when main thread is busy, requestPredictionUpdate may occur before registerPredictionUpdates and skip executing main logic due to no registered callback.
Bug: 200323675
Test: manually test on the device
Change-Id: I70631a74583b41bb392600bd7c7bcf076727a802
-rw-r--r-- | services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java b/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java index 4946ad442b0a..1af8ad344190 100644 --- a/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java +++ b/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java @@ -187,7 +187,7 @@ public class AppPredictionPerUserService extends @NonNull IPredictionCallback callback) { final AppPredictionSessionInfo sessionInfo = mSessionInfos.get(sessionId); if (sessionInfo == null) return; - final boolean serviceExists = resolveService(sessionId, false, + final boolean serviceExists = resolveService(sessionId, true, sessionInfo.mUsesPeopleService, s -> s.registerPredictionUpdates(sessionId, callback)); if (serviceExists) { |