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 214a45ee02)
This commit is contained in:
+4
@@ -95,6 +95,10 @@ public class PredictionAppTracker extends AppLaunchTracker {
|
|||||||
private AppPredictor createPredictor(Client client, int count) {
|
private AppPredictor createPredictor(Client client, int count) {
|
||||||
AppPredictionManager apm = mContext.getSystemService(AppPredictionManager.class);
|
AppPredictionManager apm = mContext.getSystemService(AppPredictionManager.class);
|
||||||
|
|
||||||
|
if (apm == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
AppPredictor predictor = apm.createAppPredictionSession(
|
AppPredictor predictor = apm.createAppPredictionSession(
|
||||||
new AppPredictionContext.Builder(mContext)
|
new AppPredictionContext.Builder(mContext)
|
||||||
.setUiSurface(client.id)
|
.setUiSurface(client.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user