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 50af435b77)
This commit is contained in:
Song Hu
2021-10-27 11:25:12 -07:00
parent b90a174204
commit 689bc29ad0

View File

@@ -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) {