Merge "Fixed PredictionAppTracker as service might not be available on device." into qt-qpr1-dev

This commit is contained in:
TreeHugger Robot
2019-08-14 22:28:34 +00:00
committed by Android (Google) Code Review
@@ -95,6 +95,10 @@ public class PredictionAppTracker extends AppLaunchTracker {
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)