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

Commit 5f1274c8 authored by thiruram's avatar thiruram Committed by Thiru Ramasamy
Browse files

Log tap on widget and appinfo system icons within ShortcutContainer.

Bug: 157765763
Change-Id: Id417728d27678cce073ff36d24b129c4435dcbe5
parent 63bf8eed
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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;
+8 −1
Original line number Diff line number Diff line
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());
        }
    }