From 2bc9e49c67515d0ae192c55c84a3a1c358aed41b Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Wed, 13 May 2020 15:06:26 -0700 Subject: Resurrect app prediciton sessions after destroy and rebind After App Prediction service restarts, existing app prediction sessions will be inactive and needs to be resurrected. Test: flash to physical device and 1. Open a couple of Personal Profile and Work Profile apps and observe that they make it to the prediction row. 2. Clear storage via the Settings > Privacy > Device Personalization Services > Personal > Clear data > All time 3. Verify prediction row should start getting updated again for subsequently opened apps Bug: 146802640 Change-Id: I74d87e374806b92649a9a3436926fb5bd5572874 --- .../com/android/server/appprediction/AppPredictionPerUserService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java b/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java index fdc5f810db22..103151dcdda5 100644 --- a/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java +++ b/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java @@ -267,6 +267,9 @@ public class AppPredictionPerUserService extends mRemoteService.destroy(); mRemoteService = null; + synchronized (mLock) { + mZombie = true; + } mRemoteService = getRemoteServiceLocked(); if (mRemoteService != null) { if (isDebug()) { -- cgit v1.2.3-59-g8ed1b