Use MetricsFeatureProvider for logging in Settings.

Bug: 31664539
Test: make RunSettingsRoboTests for regression
Test: adb logcat -b events | egrep "(sysui_|notification_)" for
      verifying log

Change-Id: Id944be7c4ff9911aebee481c2df485542f1318f0
This commit is contained in:
Fan Zhang
2016-09-22 10:43:12 -07:00
parent f91cf3cfa7
commit aa71afe597
28 changed files with 204 additions and 125 deletions

View File

@@ -16,7 +16,6 @@
package com.android.settings.accessibility;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsProto.MetricsEvent;
public class FontSizePreferenceFragmentForSetupWizard
@@ -31,7 +30,7 @@ public class FontSizePreferenceFragmentForSetupWizard
public void onStop() {
// Log the final choice in value if it's different from the previous value.
if (mCurrentIndex != mInitialIndex) {
MetricsLogger.action(getContext(), MetricsEvent.SUW_ACCESSIBILITY_FONT_SIZE,
mMetricsFeatureProvider.action(getContext(), MetricsEvent.SUW_ACCESSIBILITY_FONT_SIZE,
mCurrentIndex);
}

View File

@@ -41,7 +41,7 @@ public class ToggleScreenMagnificationPreferenceFragmentForSetupWizard
public void onStop() {
// Log the final choice in value if it's different from the previous value.
if (mToggleSwitch.isChecked() != mToggleSwitchWasInitiallyChecked) {
MetricsLogger.action(getContext(),
mMetricsFeatureProvider.action(getContext(),
MetricsEvent.SUW_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFICATION,
mToggleSwitch.isChecked());
}

View File

@@ -18,7 +18,6 @@ package com.android.settings.accessibility;
import android.os.Bundle;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsProto.MetricsEvent;
public class ToggleScreenReaderPreferenceFragmentForSetupWizard
@@ -41,7 +40,7 @@ public class ToggleScreenReaderPreferenceFragmentForSetupWizard
public void onStop() {
// Log the final choice in value if it's different from the previous value.
if (mToggleSwitch.isChecked() != mToggleSwitchWasInitiallyChecked) {
MetricsLogger.action(getContext(),
mMetricsFeatureProvider.action(getContext(),
MetricsEvent.SUW_ACCESSIBILITY_TOGGLE_SCREEN_READER, mToggleSwitch.isChecked());
}