Migrate to SettingsStatsLog from StatsLog
As part of statsd becoming a Mainline module in R, autogenerated StatsLog.write() calls are going away and replaced by *StatsLog.java that is autogenerated for each module. This CL adds autogenerated SettingsStatsLog and replaces usages of StatsLog with SettingsStatsLog. Bug: 145952197 Test: m Change-Id: I3ffdb51394017e3e48b65734d67595abd69dd70d
This commit is contained in:
16
Android.bp
16
Android.bp
@@ -4,6 +4,21 @@ java_library {
|
||||
static_libs: ["WifiTrackerLib"],
|
||||
}
|
||||
|
||||
genrule {
|
||||
name: "statslog-settings-java-gen",
|
||||
tools: ["stats-log-api-gen"],
|
||||
cmd: "$(location stats-log-api-gen) --java $(out) --module settings"
|
||||
+ " --javaPackage com.android.settings.core.instrumentation --javaClass SettingsStatsLog",
|
||||
out: ["com/android/settings/core/instrumentation/SettingsStatsLog.java"],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "statslog-settings",
|
||||
srcs: [
|
||||
":statslog-settings-java-gen",
|
||||
],
|
||||
}
|
||||
|
||||
// Build the Settings APK
|
||||
android_library {
|
||||
name: "Settings-core",
|
||||
@@ -37,6 +52,7 @@ android_library {
|
||||
"settings-log-bridge-protos-lite",
|
||||
"contextualcards",
|
||||
"settings-logtags",
|
||||
"statslog-settings",
|
||||
"zxing-core-1.7",
|
||||
],
|
||||
|
||||
|
@@ -19,7 +19,6 @@ package com.android.settings.core.instrumentation;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.util.Pair;
|
||||
import android.util.StatsLog;
|
||||
|
||||
import com.android.settingslib.core.instrumentation.LogWriter;
|
||||
|
||||
@@ -27,7 +26,7 @@ public class StatsLogWriter implements LogWriter {
|
||||
|
||||
@Override
|
||||
public void visible(Context context, int attribution, int pageId, int latency) {
|
||||
StatsLog.write(StatsLog.SETTINGS_UI_CHANGED /* Atom name */,
|
||||
SettingsStatsLog.write(SettingsStatsLog.SETTINGS_UI_CHANGED /* Atom name */,
|
||||
attribution, /* from pageId */
|
||||
SettingsEnums.PAGE_VISIBLE /* action */,
|
||||
pageId, /* target pageId */
|
||||
@@ -37,7 +36,7 @@ public class StatsLogWriter implements LogWriter {
|
||||
|
||||
@Override
|
||||
public void hidden(Context context, int pageId, int visibleTime) {
|
||||
StatsLog.write(StatsLog.SETTINGS_UI_CHANGED /* Atom name */,
|
||||
SettingsStatsLog.write(SettingsStatsLog.SETTINGS_UI_CHANGED /* Atom name */,
|
||||
SettingsEnums.PAGE_UNKNOWN /* attribution */,
|
||||
SettingsEnums.PAGE_HIDE /* action */,
|
||||
pageId,
|
||||
@@ -83,7 +82,7 @@ public class StatsLogWriter implements LogWriter {
|
||||
|
||||
@Override
|
||||
public void action(int attribution, int action, int pageId, String key, int value) {
|
||||
StatsLog.write(StatsLog.SETTINGS_UI_CHANGED /* atomName */,
|
||||
SettingsStatsLog.write(SettingsStatsLog.SETTINGS_UI_CHANGED /* atomName */,
|
||||
attribution,
|
||||
action,
|
||||
pageId,
|
||||
|
Reference in New Issue
Block a user