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

Commit 33ec1e18 authored by Muhammad Qureshi's avatar Muhammad Qureshi
Browse files

Use autogenerated SysUiStatsLog for statsd logging

StatsLogCompat is not needed because we can autogenerate StatsLog write
calls that are public. This CL switches uses of StatsLogCompat to using
SysUiStatsLog from SystemUI.

Bug: 145952197
Test: m
Test: fastboot flashall
Test: adb shell cmd stats print-logs && adb logcat "*:S statsd:*" and
inspect LAUNCHER_EVENT logging

Change-Id: Ib4f90a79f436cdd7e058fdb7027c09a5a59cc4f9
parent 4769b211
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType;
import com.android.launcher3.userevent.nano.LauncherLogProto.ItemType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.ComponentKey;
import com.android.systemui.shared.system.StatsLogCompat;
import com.android.systemui.shared.system.SysUiStatsLog;

import com.google.protobuf.nano.MessageNano;

@@ -72,8 +72,8 @@ public class StatsLogCompatManager extends StatsLogManager {
        if (ext.srcTarget[0] != null) {
            ext.srcTarget[0].item = LauncherTarget.APP_ICON;
        }
        StatsLogCompat.write(LAUNCH_APP, srcState, BACKGROUND /* dstState */,
                MessageNano.toByteArray(ext), true);
        SysUiStatsLog.write(SysUiStatsLog.LAUNCHER_EVENT, LAUNCH_APP, srcState,
                BACKGROUND /* dstState */, MessageNano.toByteArray(ext), true);
    }

    @Override
@@ -82,8 +82,8 @@ public class StatsLogCompatManager extends StatsLogManager {
        ext.srcTarget = new LauncherTarget[SUPPORTED_TARGET_DEPTH];
        int srcState = OVERVIEW;
        fillInLauncherExtension(v, ext);
        StatsLogCompat.write(LAUNCH_TASK, srcState, BACKGROUND /* dstState */,
                MessageNano.toByteArray(ext), true);
        SysUiStatsLog.write(SysUiStatsLog.LAUNCHER_EVENT, LAUNCH_TASK, srcState,
                BACKGROUND /* dstState */, MessageNano.toByteArray(ext), true);
    }

    @Override
@@ -92,8 +92,8 @@ public class StatsLogCompatManager extends StatsLogManager {
        ext.srcTarget = new LauncherTarget[SUPPORTED_TARGET_DEPTH];
        int srcState = OVERVIEW;
        fillInLauncherExtension(v, ext);
        StatsLogCompat.write(DISMISS_TASK, srcState, BACKGROUND /* dstState */,
                MessageNano.toByteArray(ext), true);
        SysUiStatsLog.write(SysUiStatsLog.LAUNCHER_EVENT, DISMISS_TASK, srcState,
                BACKGROUND /* dstState */, MessageNano.toByteArray(ext), true);
    }

    @Override
@@ -103,7 +103,7 @@ public class StatsLogCompatManager extends StatsLogManager {
        int srcState = mStateProvider.getCurrentState();
        fillInLauncherExtensionWithPageId(ext, pageId);
        int launcherAction = isSwipingToLeft ? Launcher.SWIPE_LEFT : Launcher.SWIPE_RIGHT;
        StatsLogCompat.write(launcherAction, srcState, srcState,
        SysUiStatsLog.write(SysUiStatsLog.LAUNCHER_EVENT, launcherAction, srcState, srcState,
                MessageNano.toByteArray(ext), true);
    }