From e8c0f83fb289aeb7ffae97a54bc714374df1eb86 Mon Sep 17 00:00:00 2001 From: Samuel Fufa Date: Tue, 16 Jun 2020 14:24:49 -0700 Subject: [PATCH] Avoid Crash when longpressing disabled predicted item If a view does not handle its long press and return true, View.java calls getParent().showContextMenuForChild(this). However, in Hybrid hotseat case, predicted icons are removed from the hotseat when user long presses an icon. This will result in getParent() returning null. Bug: 159064799 Change-Id: I80d8f27cbc20b94b0381e767584a1f6854d17e2c --- .../launcher3/hybridhotseat/HotseatPredictionController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java index 30a34e46eb..b34d3cdbf1 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java @@ -122,7 +122,7 @@ public class HotseatPredictionController implements DragController.DragListener, if (mLauncher.getWorkspace().isSwitchingState()) return false; // Start the drag mLauncher.getWorkspace().beginDragShared(v, this, new DragOptions()); - return false; + return true; }; public HotseatPredictionController(Launcher launcher) {