commit | 6e4a1ef16cfa253fa8b587e1a1e7c8118ceea2a6 | [log] [tgz] |
---|---|---|
author | Felipe Leme <felipeal@google.com> | Wed Aug 14 09:40:04 2019 -0700 |
committer | Felipe Leme <felipeal@google.com> | Wed Aug 14 11:20:20 2019 -0700 |
tree | 948c75844f70a0ef6f322c63c2673327caa00b7e | |
parent | b6fcc1f46eeb539171ecbdd3f6855be067066d8d [diff] |
Fixed PredictionAppTracker as service might not be available on device. Fixes: 139416391 Bug: 135218095 Test: echo 'in TreeHugger we trust' Change-Id: Iea89b3d379792327657e01869c9494975e7b0306 (cherry picked from commit 214a45ee02674712542dabdb7d8c70ace21f4501)
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)