Logging for the feature "Text and reading options" in Android T.

Logging for the status of five features “Font size”, “Display size”, “Bold Text”, “High contrast text”, and “Reset” in the “Display size and text” page.

Bug: 222661478
Test: manual test
Change-Id: I33060fca860e02ddac7716275e8682e70fbaff1f
This commit is contained in:
Peter_Liang
2022-04-22 01:53:04 +08:00
parent fd7153ed39
commit fcce62aa77
14 changed files with 411 additions and 9 deletions

View File

@@ -23,7 +23,9 @@ import androidx.annotation.Nullable;
import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.instrumentation.SettingsStatsLog;
import com.android.settingslib.widget.LayoutPreference;
/**
@@ -32,6 +34,9 @@ import com.android.settingslib.widget.LayoutPreference;
class TextReadingResetController extends BasePreferenceController {
private final View.OnClickListener mOnResetClickListener;
@EntryPoint
private int mEntryPoint;
TextReadingResetController(Context context, String preferenceKey,
@Nullable View.OnClickListener listener) {
super(context, preferenceKey);
@@ -52,10 +57,25 @@ class TextReadingResetController extends BasePreferenceController {
view.setOnClickListener(v -> {
if (mOnResetClickListener != null) {
mOnResetClickListener.onClick(v);
SettingsStatsLog.write(
SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED,
AccessibilityStatsLogUtils.convertToItemKeyName(getPreferenceKey()),
/* reset */ -1,
AccessibilityStatsLogUtils.convertToEntryPoint(mEntryPoint));
}
});
}
/**
* The entry point is used for logging.
*
* @param entryPoint from which settings page
*/
void setEntryPoint(@EntryPoint int entryPoint) {
mEntryPoint = entryPoint;
}
/**
* Interface for resetting to default state.
*/