Merge "Fixed PredictionAppTracker as service might not be available on device." into qt-qpr1-dev
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionAppTracker.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionAppTracker.java
index 8f1282d..24fc61b 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionAppTracker.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionAppTracker.java
@@ -95,6 +95,10 @@
     private AppPredictor createPredictor(Client client, int count) {
         AppPredictionManager apm = mContext.getSystemService(AppPredictionManager.class);
 
+        if (apm == null) {
+          return null;
+        }
+
         AppPredictor predictor = apm.createAppPredictionSession(
                 new AppPredictionContext.Builder(mContext)
                         .setUiSurface(client.id)