[Settings] Add preference click metric log

- Move the log point of onPreferenceTreeClick from DashboardFragment to
  it's super class InstrumentedPreferenceFragment for better coverage.
- Write the preference click metric log in PreferenceController handling
  case in DashboardFragment which will skip super class's log point.

Bug: 137559984
Test: robotest
Change-Id: I67178f613c74f755e20fc9dc41319974cb02e83c
This commit is contained in:
Jason Chiu
2019-12-12 17:31:28 +08:00
parent e7e4dd905a
commit 1281e595e4
4 changed files with 18 additions and 12 deletions

View File

@@ -400,16 +400,15 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
ProfileSelectDialog.updateUserHandlesIfNeeded(mContext, tile);
if (tile.userHandle == null || tile.isPrimaryProfileOnly()) {
mMetricsFeatureProvider.logDashboardStartIntent(mContext, intent, sourceMetricCategory);
mMetricsFeatureProvider.logStartedIntent(intent, sourceMetricCategory);
activity.startActivityForResult(intent, 0);
} else if (tile.userHandle.size() == 1) {
mMetricsFeatureProvider.logDashboardStartIntent(mContext, intent, sourceMetricCategory);
mMetricsFeatureProvider.logStartedIntent(intent, sourceMetricCategory);
activity.startActivityForResultAsUser(intent, 0, tile.userHandle.get(0));
} else {
final UserHandle userHandle = intent.getParcelableExtra(EXTRA_USER);
if (userHandle != null && tile.userHandle.contains(userHandle)) {
mMetricsFeatureProvider.logDashboardStartIntent(
mContext, intent, sourceMetricCategory);
mMetricsFeatureProvider.logStartedIntent(intent, sourceMetricCategory);
activity.startActivityForResultAsUser(intent, 0, userHandle);
} else {
ProfileSelectDialog.show(activity.getSupportFragmentManager(), tile);