Use EXTRA_ENTRYPOINT to log entry point for metrics

1. Extra name: EXTRA_ENTRYPOINT
2. Value: integer which is from SettingsEnums.EntryPointType
// access physical keyboard settings through keyboard configured notification entry point
KEYBOARD_CONFIGURED_NOTIFICATION = 0;
// access physical keyboard settings through keyboard settings entry point
KEYBOARD_SETTINGS = 1;
// access physical keyboard settings through connected devices settings entry point
CONNECTED_DEVICES_SETTINGS = 2;

Bug: 271391879
Test: manual and check the device log.
Change-Id: I0d5144790e184eb3374d4615d8874619c372742a
This commit is contained in:
danielwbhuang
2023-07-06 20:28:44 +08:00
parent 2070808a62
commit f76c528e5b
4 changed files with 7 additions and 14 deletions

View File

@@ -123,9 +123,9 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
}
InputDeviceIdentifier inputDeviceIdentifier = activity.getIntent().getParcelableExtra(
KeyboardLayoutPickerFragment.EXTRA_INPUT_DEVICE_IDENTIFIER);
String intentFromWhere =
activity.getIntent().getStringExtra(NewKeyboardSettingsUtils.EXTRA_INTENT_FROM);
if (intentFromWhere != null) {
int intentFromWhere =
activity.getIntent().getIntExtra(android.provider.Settings.EXTRA_ENTRYPOINT, -1);
if (intentFromWhere != -1) {
mMetricsFeatureProvider.action(
getContext(), SettingsEnums.ACTION_OPEN_PK_SETTINGS_FROM, intentFromWhere);
}