From 689bc29ad00b7235da25e78c32edbc559959095a Mon Sep 17 00:00:00 2001 From: Song Hu Date: Wed, 27 Oct 2021 11:25:12 -0700 Subject: [PATCH] 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 (cherry picked from commit 50af435b775bdf61f10fbd99ffd4ace86ecb7619) --- .../server/appprediction/AppPredictionPerUserService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java b/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java index 4946ad442b0a8..1af8ad3441905 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) {