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

Commit 6a607e7c authored by Fan Zhang's avatar Fan Zhang
Browse files

Delete actionWithSource. Caller can use action directly.

Bug: 117860032
Test: robotest
Change-Id: Ie9d8a8605e4c02568394e50d59a263cd72a6fbf6
parent ed50a5ac
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@ import com.android.internal.logging.nano.MetricsProto;
 */
public class EventLogWriter implements LogWriter {

    private final MetricsLogger mMetricsLogger = new MetricsLogger();

    @Override
    public void visible(Context context, int source, int category) {
        final LogMaker logMaker = new LogMaker(category)
@@ -49,16 +47,6 @@ public class EventLogWriter implements LogWriter {
        action(context, category, "", taggedData);
    }

    @Override
    public void actionWithSource(Context context, int source, int category) {
        final LogMaker logMaker = new LogMaker(category)
                .setType(MetricsProto.MetricsEvent.TYPE_ACTION);
        if (source != MetricsProto.MetricsEvent.VIEW_UNKNOWN) {
            logMaker.addTaggedData(MetricsProto.MetricsEvent.FIELD_CONTEXT, source);
        }
        MetricsLogger.action(logMaker);
    }

    @Override
    public void action(Context context, int category, int value) {
        MetricsLogger.action(context, category, value);
+0 −5
Original line number Diff line number Diff line
@@ -38,11 +38,6 @@ public interface LogWriter {
     */
    void action(Context context, int category, Pair<Integer, Object>... taggedData);

    /**
     * Logs an user action.
     */
    void actionWithSource(Context context, int source, int category);

    /**
     * Logs an user action.
     */
+0 −6
Original line number Diff line number Diff line
@@ -53,12 +53,6 @@ public class MetricsFeatureProvider {
        }
    }

    public void actionWithSource(Context context, int source, int category) {
        for (LogWriter writer : mLoggerWriters) {
            writer.actionWithSource(context, source, category);
        }
    }

    public void action(Context context, int category, Pair<Integer, Object>... taggedData) {
        for (LogWriter writer : mLoggerWriters) {
            writer.action(context, category, taggedData);