From 53a107f2d41ab1674b535b55b070ea348ad2dcea Mon Sep 17 00:00:00 2001 From: Kate Montgomery Date: Mon, 14 Feb 2022 15:59:55 +0000 Subject: [PATCH] Log clicks on the "Show System / Hide System" button in Location Settings recent accesses. Bug: 191503437 Test: manual Change-Id: I2bcae63832c0a38a95f8087e2a4b5cf625ee7604 --- .../RecentLocationAccessSeeAllPreferenceController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/location/RecentLocationAccessSeeAllPreferenceController.java b/src/com/android/settings/location/RecentLocationAccessSeeAllPreferenceController.java index e3379c7da7f..75406f7132a 100644 --- a/src/com/android/settings/location/RecentLocationAccessSeeAllPreferenceController.java +++ b/src/com/android/settings/location/RecentLocationAccessSeeAllPreferenceController.java @@ -27,7 +27,9 @@ import androidx.preference.PreferenceScreen; import com.android.settings.R; import com.android.settings.dashboard.profileselector.ProfileSelectFragment; +import com.android.settings.overlay.FeatureFactory; import com.android.settingslib.applications.RecentAppOpsAccess; +import com.android.settingslib.core.instrumentation.MetricsFeatureProvider; import com.android.settingslib.widget.AppPreference; import java.util.ArrayList; @@ -37,8 +39,10 @@ import java.util.List; public class RecentLocationAccessSeeAllPreferenceController extends LocationBasePreferenceController { - private PreferenceScreen mCategoryAllRecentLocationAccess; private final RecentAppOpsAccess mRecentLocationAccesses; + + private PreferenceScreen mCategoryAllRecentLocationAccess; + private MetricsFeatureProvider mMetricsFeatureProvider; private boolean mShowSystem = false; private Preference mPreference; @@ -47,6 +51,7 @@ public class RecentLocationAccessSeeAllPreferenceController mShowSystem = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, 0) == 1; mRecentLocationAccesses = RecentAppOpsAccess.createForLocation(context); + mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider(); } @Override @@ -99,6 +104,7 @@ public class RecentLocationAccessSeeAllPreferenceController mShowSystem = showSystem; if (mPreference != null) { updateState(mPreference); + mMetricsFeatureProvider.logClickedPreference(mPreference, getMetricsCategory()); } } }