Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffad9620 authored by Hyunyoung Song's avatar Hyunyoung Song
Browse files

Add user event logging for action on search box

b/31772967

Change-Id: Ide652ddfad931e392b21f5a2bbdf9f07729d0383
parent 1b7e9bc0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ enum ItemType {
  WIDGET = 3;
  FOLDER_ICON = 4;
  DEEPSHORTCUT = 5;
  SEARCHBOX = 6;
}

// Used to define what type of container a Target would represent.
+12 −0
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ import java.util.Locale;

/**
 * Manages the creation of {@link LauncherEvent}.
 * To debug this class, execute following command before sideloading a new apk.
 *
 * $ adb shell setprop log.tag.UserEvent VERBOSE
 */
public class UserEventDispatcher {

@@ -152,6 +155,15 @@ public class UserEventDispatcher {
        dispatchUserEvent(ev, intent);
    }

    public void logActionOnItem(int action, int itemType) {
        LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, Target.ITEM);
        event.action.touch = action;
        event.srcTarget[0].itemType = itemType;
        event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis;
        event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis;
        dispatchUserEvent(event, null);
    }

    public void logActionOnControl(int action, int controlType) {
        LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, Target.CONTROL);
        event.action.touch = action;