Add WW log for drag events from longpress popup window.

Bug: 157765763
Sample Log: https://docs.google.com/document/d/1CBP2yTcXdFhPdNG5ZmWFKSgd8mDbMevY-akVlUXPLDo/edit#bookmark=id.368csp9y1pwc

Change-Id: I73024f2c8010e77b6f89829fda64130f54ff81f1
This commit is contained in:
thiruram
2020-06-01 12:03:19 -07:00
committed by Thiru Ramasamy
parent 77aaa94bc2
commit 63bf8eedf9
4 changed files with 19 additions and 2 deletions
+6
View File
@@ -51,6 +51,7 @@ message ContainerInfo {
WidgetsContainer widgets_container = 5;
PredictionContainer prediction_container = 6;
SearchResultContainer search_result_container = 7;
ShortcutsContainer shortcuts_container = 8;
}
}
@@ -69,6 +70,11 @@ message PredictionContainer {
message SearchResultContainer {
}
// Container for package specific shortcuts to deep links and notifications.
// Typically shown as popup window by longpressing on an icon.
message ShortcutsContainer {
}
enum Origin {
UNKNOWN = 0;
DEFAULT_LAYOUT = 1; // icon automatically placed in workspace, folder, hotseat
@@ -154,9 +154,9 @@ public class LauncherSettings {
public static final int CONTAINER_HOTSEAT_PREDICTION = -103;
public static final int CONTAINER_ALL_APPS = -104;
public static final int CONTAINER_WIDGETS_TRAY = -105;
// Represents search results view.
public static final int CONTAINER_SEARCH_RESULTS = -106;
public static final int CONTAINER_SHORTCUTS = -107;
public static final String containerToString(int container) {
switch (container) {
@@ -166,6 +166,7 @@ public class LauncherSettings {
case CONTAINER_ALL_APPS: return "all_apps";
case CONTAINER_WIDGETS_TRAY: return "widgets_tray";
case CONTAINER_SEARCH_RESULTS: return "search_result";
case CONTAINER_SHORTCUTS: return "shortcuts";
default: return String.valueOf(container);
}
}
@@ -22,6 +22,7 @@ import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PREDICTION;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_SEARCH_RESULTS;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_SHORTCUTS;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_WIDGETS_TRAY;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET;
@@ -45,6 +46,7 @@ import com.android.launcher3.logger.LauncherAtom.AllAppsContainer;
import com.android.launcher3.logger.LauncherAtom.ContainerInfo;
import com.android.launcher3.logger.LauncherAtom.PredictionContainer;
import com.android.launcher3.logger.LauncherAtom.SearchResultContainer;
import com.android.launcher3.logger.LauncherAtom.ShortcutsContainer;
import com.android.launcher3.util.ContentWriter;
import java.util.Optional;
@@ -363,6 +365,10 @@ public class ItemInfo {
return ContainerInfo.newBuilder()
.setSearchResultContainer(SearchResultContainer.getDefaultInstance())
.build();
case CONTAINER_SHORTCUTS:
return ContainerInfo.newBuilder()
.setShortcutsContainer(ShortcutsContainer.getDefaultInstance())
.build();
}
return ContainerInfo.getDefaultInstance();
}
@@ -16,6 +16,7 @@
package com.android.launcher3.popup;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_SHORTCUTS;
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.Utilities.squaredTouchSlop;
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
@@ -61,6 +62,7 @@ import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.dragndrop.DraggableView;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.notification.NotificationInfo;
import com.android.launcher3.notification.NotificationItemView;
import com.android.launcher3.notification.NotificationKeyData;
@@ -675,8 +677,10 @@ public class PopupContainerWithArrow<T extends BaseDraggingActivity> extends Arr
iconShift.y = mIconLastTouchPos.y - mLauncher.getDeviceProfile().iconSizePx;
DraggableView draggableView = DraggableView.ofType(DraggableView.DRAGGABLE_ICON);
WorkspaceItemInfo itemInfo = sv.getFinalInfo();
itemInfo.container = CONTAINER_SHORTCUTS;
DragView dv = mLauncher.getWorkspace().beginDragShared(sv.getIconView(), draggableView,
mContainer, sv.getFinalInfo(),
mContainer, itemInfo,
new ShortcutDragPreviewProvider(sv.getIconView(), iconShift),
new DragOptions());
dv.animateShift(-iconShift.x, -iconShift.y);