[Physical Keyboard] Add Metrics event for keyboard relates pages

Bug: 377602364
Flag: com.android.settings.keyboard.keyboard_and_touchpad_a11y_new_page_enabled
Test: atest packages/apps/Settings/tests/robotests/src/com/android/settings/inputmethod
Change-Id: I28fc5c7676dcce2ad4aa63ea5745f5597558b0c1
This commit is contained in:
shaoweishen
2024-12-25 05:57:16 +00:00
parent 1ef5e68927
commit 33f62b4e01
9 changed files with 64 additions and 2 deletions

View File

@@ -16,6 +16,10 @@
package com.android.settings.inputmethod;
import static android.app.settings.SettingsEnums.ACTION_BOUNCE_KEYS_CUSTOM_VALUE_CHANGE;
import static android.app.settings.SettingsEnums.ACTION_BOUNCE_KEYS_DISABLED;
import static android.app.settings.SettingsEnums.ACTION_BOUNCE_KEYS_ENABLED;
import android.content.Context;
import android.hardware.input.InputSettings;
import android.net.Uri;
@@ -78,9 +82,17 @@ public class KeyboardAccessibilityBounceKeysController extends
@Override
public boolean setChecked(boolean isChecked) {
updateInputSettingKeysValue(isChecked ? BOUNCE_KEYS_THRESHOLD : 0);
mMetricsFeatureProvider.action(mContext,
isChecked ? ACTION_BOUNCE_KEYS_ENABLED : ACTION_BOUNCE_KEYS_DISABLED);
return true;
}
@Override
protected void onCustomValueUpdated(int thresholdTimeMillis) {
mMetricsFeatureProvider.action(mContext, ACTION_BOUNCE_KEYS_CUSTOM_VALUE_CHANGE,
thresholdTimeMillis);
}
@Override
protected void onInputSettingUpdated() {
if (mPrimaryPreference != null) {