From 8e90ee03629ecab6075a4b4758beddcd67ed8977 Mon Sep 17 00:00:00 2001 From: Samuel Fufa Date: Sun, 14 Jun 2020 18:29:20 -0700 Subject: [PATCH] [race condition] Improve hotseat availability when launcher is recreated In cases where onCreate does not get called before bindPredictedItems, mHotseatPredictionController will be null. This results in the hotseat remaining empty until AiAi sends predictions. Bug: 158867468 Test: Manual Change-Id: I4f3c3fc41f489e96a9f91dc9505202ae9ce9cce1 --- .../com/android/launcher3/uioverrides/QuickstepLauncher.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 3b45ec955d..77d71a3ff2 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -29,7 +29,6 @@ import static com.android.quickstep.SysUINavigationMode.Mode.NO_BUTTON; import android.content.Intent; import android.content.res.Configuration; -import android.os.Bundle; import android.util.Log; import android.view.View; @@ -90,8 +89,8 @@ public class QuickstepLauncher extends BaseQuickstepLauncher { SystemUiProxy.INSTANCE.get(context).setShelfHeight(arg1 != 0, arg2); @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + protected void setupViews() { + super.setupViews(); if (FeatureFlags.ENABLE_HYBRID_HOTSEAT.get()) { mHotseatPredictionController = new HotseatPredictionController(this); mHotseatPredictionController.createPredictor();