Log shortcuts open on ACTION_UP instead of in showForIcon().
- We only want to log when the container is opened and potentially used, not when a long press is followed by a drag-and-drop. - Also cleaned up code that was determining the container of the app icon, since LaunchSourceProvider.fillInLaunchSourceData() can do that instead (it's more robust and consistent). Bug: 30791570 Change-Id: I05b6750f26182fda8a9940ac66f1371c2d228ca9
This commit is contained in:
@@ -208,12 +208,8 @@ public class AllAppsRecyclerView extends BaseRecyclerView
|
||||
|
||||
@Override
|
||||
public void fillInLaunchSourceData(View v, ItemInfo info, Target target, Target targetParent) {
|
||||
targetParent.containerType = getContainerType(v);
|
||||
}
|
||||
|
||||
public int getContainerType(View v) {
|
||||
if (mApps.hasFilter()) {
|
||||
return LauncherLogProto.SEARCHRESULT;
|
||||
targetParent.containerType = LauncherLogProto.SEARCHRESULT;
|
||||
} else {
|
||||
if (v instanceof BubbleTextView) {
|
||||
BubbleTextView icon = (BubbleTextView) v;
|
||||
@@ -222,11 +218,12 @@ public class AllAppsRecyclerView extends BaseRecyclerView
|
||||
List<AlphabeticalAppsList.AdapterItem> items = mApps.getAdapterItems();
|
||||
AlphabeticalAppsList.AdapterItem item = items.get(position);
|
||||
if (item.viewType == AllAppsGridAdapter.VIEW_TYPE_PREDICTION_ICON) {
|
||||
return LauncherLogProto.PREDICTION;
|
||||
targetParent.containerType = LauncherLogProto.PREDICTION;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
return LauncherLogProto.ALLAPPS;
|
||||
targetParent.containerType = LauncherLogProto.ALLAPPS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user