Events checking for long press events

Also fixing duplicate long press events resulting from both framework
and Launcher own detection reporting long presses.

Change-Id: Ib46de5bd60850f1c5578992c8c1172ddbc0961f3
This commit is contained in:
vadimt
2020-03-31 19:06:41 -07:00
parent d4e7782d75
commit e277fec466
9 changed files with 47 additions and 5 deletions

View File

@@ -33,6 +33,8 @@ import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.touch.ItemLongClickListener;
import com.android.launcher3.uioverrides.WallpaperColorInfo;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
@@ -92,6 +94,8 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
@Override
public boolean onLongClick(View v) {
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick");
v.cancelLongPress();
if (!ItemLongClickListener.canStartDrag(mLauncher)) return false;
if (v instanceof WidgetCell) {