Merge "Switch count logging to action."
diff --git a/src/com/android/settings/core/instrumentation/StatsLogWriter.java b/src/com/android/settings/core/instrumentation/StatsLogWriter.java
index ed711bb..2617259 100644
--- a/src/com/android/settings/core/instrumentation/StatsLogWriter.java
+++ b/src/com/android/settings/core/instrumentation/StatsLogWriter.java
@@ -83,11 +83,6 @@
}
@Override
- public void count(Context context, String name, int value) {
- // No-op
- }
-
- @Override
public void action(int attribution, int action, int pageId, String key, int value) {
StatsLog.write(StatsLog.SETTINGS_UI_CHANGED /* atomName */,
attribution,
diff --git a/src/com/android/settings/widget/SwitchBar.java b/src/com/android/settings/widget/SwitchBar.java
index 8afba40..6cde644 100644
--- a/src/com/android/settings/widget/SwitchBar.java
+++ b/src/com/android/settings/widget/SwitchBar.java
@@ -18,6 +18,7 @@
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
@@ -143,8 +144,13 @@
@Override
public void onClick(View v) {
if (mDisabledByAdmin) {
- mMetricsFeatureProvider.count(mContext,
- mMetricsTag + "/switch_bar|restricted", 1);
+ mMetricsFeatureProvider.action(
+ SettingsEnums.PAGE_UNKNOWN,
+ SettingsEnums.ACTION_SETTINGS_PREFERENCE_CHANGE,
+ SettingsEnums.PAGE_UNKNOWN,
+ mMetricsTag + "/switch_bar|restricted",
+ 1);
+
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(context,
mEnforcedAdmin);
}
@@ -287,7 +293,12 @@
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (mLoggingIntialized) {
- mMetricsFeatureProvider.count(mContext, mMetricsTag + "/switch_bar|" + isChecked, 1);
+ mMetricsFeatureProvider.action(
+ SettingsEnums.PAGE_UNKNOWN,
+ SettingsEnums.ACTION_SETTINGS_PREFERENCE_CHANGE,
+ SettingsEnums.PAGE_UNKNOWN,
+ mMetricsTag + "/switch_bar",
+ isChecked ? 1 : 0);
}
mLoggingIntialized = true;
propagateChecked(isChecked);