Log tap on widget and appinfo system icons within ShortcutContainer.

Bug: 157765763
Change-Id: Id417728d27678cce073ff36d24b129c4435dcbe5
This commit is contained in:
thiruram
2020-06-01 14:05:13 -07:00
committed by Thiru Ramasamy
parent 63bf8eedf9
commit 5f1274c863
2 changed files with 17 additions and 2 deletions
@@ -94,7 +94,15 @@ public class StatsLogManager implements ResourceBasedOverride {
@UiEvent(doc = "User cancelled uninstalling the package after dropping on "
+ "the icon onto 'Uninstall' button in the target bar")
LAUNCHER_ITEM_UNINSTALL_CANCELLED(470);
LAUNCHER_ITEM_UNINSTALL_CANCELLED(470),
@UiEvent(doc = "User opened package specific widgets list by tapping on widgets system "
+ "shortcut within longpress popup window.")
LAUNCHER_SYSTEM_SHORTCUT_WIDGETS_TAP(514),
@UiEvent(doc = "User opened app info of the package by tapping on appinfo system shortcut "
+ "within longpress popup window.")
LAUNCHER_SYSTEM_SHORTCUT_APP_INFO_TAP(515);
// ADD MORE
private final int mId;
@@ -1,5 +1,7 @@
package com.android.launcher3.popup;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_APP_INFO_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_WIDGETS_TAP;
import android.app.ActivityOptions;
import android.content.Context;
@@ -103,7 +105,6 @@ public abstract class SystemShortcut<T extends BaseDraggingActivity> extends Ite
};
public static class Widgets extends SystemShortcut<Launcher> {
public Widgets(Launcher target, ItemInfo itemInfo) {
super(R.drawable.ic_widget, R.string.widget_button_text, target, itemInfo);
}
@@ -117,6 +118,9 @@ public abstract class SystemShortcut<T extends BaseDraggingActivity> extends Ite
widgetsBottomSheet.populateAndShow(mItemInfo);
mTarget.getUserEventDispatcher().logActionOnControl(Action.Touch.TAP,
ControlType.WIDGETS_BUTTON, view);
// TODO(thiruram): Fix missing container info when item is inside folder.
mTarget.getStatsLogManager().log(LAUNCHER_SYSTEM_SHORTCUT_WIDGETS_TAP,
mItemInfo.buildProto());
}
}
@@ -137,6 +141,9 @@ public abstract class SystemShortcut<T extends BaseDraggingActivity> extends Ite
mItemInfo, sourceBounds, ActivityOptions.makeBasic().toBundle());
mTarget.getUserEventDispatcher().logActionOnControl(Action.Touch.TAP,
ControlType.APPINFO_TARGET, view);
// TODO(thiruram): Fix missing container info when item is inside folder.
mTarget.getStatsLogManager().log(LAUNCHER_SYSTEM_SHORTCUT_APP_INFO_TAP,
mItemInfo.buildProto());
}
}