Adds westworld logging events for drag and drop on target bar buttons.

This would add below set of LauncherEvents:
* LAUNCHER_ITEM_DROPPED_ON_REMOVE
* LAUNCHER_ITEM_DROPPED_ON_CANCEL
* LAUNCHER_ITEM_DROPPED_ON_DONT_SUGGEST
* LAUNCHER_ITEM_DROPPED_ON_UNINSTALL
* LAUNCHER_ITEM_UNINSTALL_COMPLETED
* LAUNCHER_ITEM_UNINSTALL_CANCELLED

Sample Logs: https://docs.google.com/document/d/1CBP2yTcXdFhPdNG5ZmWFKSgd8mDbMevY-akVlUXPLDo/edit#bookmark=id.3ndtl1dalhdt

Bug: 152978018
Change-Id: I055a1b001524753eea71384b4765522f5946fbbc
This commit is contained in:
thiruram
2020-05-11 11:19:58 -07:00
parent 7dcd4d6ed6
commit ff48451ecd
4 changed files with 68 additions and 6 deletions

View File

@@ -16,20 +16,24 @@
package com.android.launcher3.logging;
import android.content.Context;
import android.util.Log;
import com.android.launcher3.R;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.logger.LauncherAtom.ItemInfo;
import com.android.launcher3.logging.StatsLogUtils.LogStateProvider;
import com.android.launcher3.util.ResourceBasedOverride;
/**
* Handles the user event logging in R+.
* All of the event id is defined here.
* All of the event ids are defined here.
* Most of the methods are dummy methods for Launcher3
* Actual call happens only for Launcher variant that implements QuickStep.
*/
public class StatsLogManager implements ResourceBasedOverride {
private static final String TAG = "StatsLogManager";
interface EventEnum {
int getId();
}
@@ -37,19 +41,46 @@ public class StatsLogManager implements ResourceBasedOverride {
public enum LauncherEvent implements EventEnum {
@LauncherUiEvent(doc = "App launched from workspace, hotseat or folder in launcher")
LAUNCHER_APP_LAUNCH_TAP(338),
@LauncherUiEvent(doc = "Task launched from overview using TAP")
LAUNCHER_TASK_LAUNCH_TAP(339),
@LauncherUiEvent(doc = "Task launched from overview using SWIPE DOWN")
LAUNCHER_TASK_LAUNCH_SWIPE_DOWN(340),
@LauncherUiEvent(doc = "TASK dismissed from overview using SWIPE UP")
LAUNCHER_TASK_DISMISS_SWIPE_UP(341),
@LauncherUiEvent(doc = "User dragged a launcher item")
LAUNCHER_ITEM_DRAG_STARTED(383),
@LauncherUiEvent(doc = "A dragged launcher item is successfully dropped")
LAUNCHER_ITEM_DROP_COMPLETED(385),
@LauncherUiEvent(doc = "A dragged launcher item is successfully dropped on another item "
+ "resulting in new folder creation")
LAUNCHER_ITEM_DROP_FOLDER_CREATED(386);
+ "resulting in a new folder creation")
LAUNCHER_ITEM_DROP_FOLDER_CREATED(386),
@LauncherUiEvent(doc = "A dragged item is dropped on 'Remove' button in the target bar")
LAUNCHER_ITEM_DROPPED_ON_REMOVE(465),
@LauncherUiEvent(doc = "A dragged item is dropped on 'Cancel' button in the target bar")
LAUNCHER_ITEM_DROPPED_ON_CANCEL(466),
@LauncherUiEvent(doc = "A predicted item is dragged and dropped on 'Don't suggest app'"
+ " button in the target bar")
LAUNCHER_ITEM_DROPPED_ON_DONT_SUGGEST(467),
@LauncherUiEvent(doc = "A dragged item is dropped on 'Uninstall' button in target bar")
LAUNCHER_ITEM_DROPPED_ON_UNINSTALL(468),
@LauncherUiEvent(doc = "User completed uninstalling the package after dropping on "
+ "the icon onto 'Uninstall' button in the target bar")
LAUNCHER_ITEM_UNINSTALL_COMPLETED(469),
@LauncherUiEvent(doc = "User cancelled uninstalling the package after dropping on "
+ "the icon onto 'Uninstall' button in the target bar")
LAUNCHER_ITEM_UNINSTALL_CANCELLED(470);
// ADD MORE
private final int mId;
@@ -77,6 +108,14 @@ public class StatsLogManager implements ResourceBasedOverride {
return mgr;
}
/**
* Logs an event and accompanying {@link ItemInfo}
*/
public void log(LauncherEvent event, InstanceId instanceId) {
Log.d(TAG, String.format("%s(InstanceId:%s)", event.name(), instanceId));
// Call StatsLog method
}
/**
* Logs an event and accompanying {@link LauncherAtom.ItemInfo}
*/