From de869b3624f07f2b17bf6f2ac8c840b9da4dc573 Mon Sep 17 00:00:00 2001 From: helencheuk Date: Thu, 13 Mar 2025 15:15:54 +0000 Subject: Check null when getting drop view in DragController When the flag is on, there are some cases dropTarget is null: TaplTestsTaskbar.testOpenMenu_fromTaskbarAllApps TaplTestsTaskbar.testLaunchShortcutInSplitscreen TaplTestsTaskbar.testLaunchShortcut Add logic to check null before getting drop view and calling drop complete. Bug: 343650193 Test: TaplTestsTaskbar.testOpenMenu_fromTaskbarAllApps Test: TaplTestsTaskbar.testLaunchShortcutInSplitscreen Test: TaplTestsTaskbar.testLaunchShortcut Flag: com.android.launcher3.remove_apps_refresh_on_right_click Change-Id: If8ce93bd6f7d0506e2272ca17dd7c19666549cfa --- src/com/android/launcher3/dragndrop/DragController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java index 284faba9da..415a2c6230 100644 --- a/src/com/android/launcher3/dragndrop/DragController.java +++ b/src/com/android/launcher3/dragndrop/DragController.java @@ -544,9 +544,10 @@ public abstract class DragController } accepted = true; } + + final View dropTargetAsView = dropTarget.getDropView(); + dispatchDropComplete(dropTargetAsView, accepted); } - final View dropTargetAsView = dropTarget.getDropView(); - dispatchDropComplete(dropTargetAsView, accepted); } private DropTarget findDropTarget(final int x, final int y) { -- cgit v1.2.3-59-g8ed1b