Loading src/com/android/settings/core/instrumentation/MetricsFeatureProvider.java +1 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,7 @@ public class MetricsFeatureProvider { } action(context, MetricsProto.MetricsEvent.ACTION_SETTINGS_TILE_CLICK, action, Pair.create(MetricsProto.MetricsEvent.FIELD_CONTEXT, sourceMetricsCategory)); return; } else if (TextUtils.equals(cn.getPackageName(), context.getPackageName())) { // Going to a Setting internal page, skip click logging in favor of page's own // visibility logging. Loading tests/robotests/src/com/android/settings/core/instrumentation/MetricsFeatureProviderTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,19 @@ public class MetricsFeatureProviderTest { verifyNoMoreInteractions(mLogWriter); } @Test public void logDashboardStartIntent_intentHasNoComponent_shouldLog() { final Intent intent = new Intent(Intent.ACTION_ASSIST); mProvider.logDashboardStartIntent(mContext, intent, MetricsEvent.SETTINGS_GESTURES); verify(mLogWriter).action( eq(mContext), eq(MetricsEvent.ACTION_SETTINGS_TILE_CLICK), anyString(), eq(Pair.create(MetricsEvent.FIELD_CONTEXT, MetricsEvent.SETTINGS_GESTURES))); } @Test public void logDashboardStartIntent_intentIsExternal_shouldLog() { final Intent intent = new Intent().setComponent(new ComponentName("pkg", "cls")); Loading Loading
src/com/android/settings/core/instrumentation/MetricsFeatureProvider.java +1 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,7 @@ public class MetricsFeatureProvider { } action(context, MetricsProto.MetricsEvent.ACTION_SETTINGS_TILE_CLICK, action, Pair.create(MetricsProto.MetricsEvent.FIELD_CONTEXT, sourceMetricsCategory)); return; } else if (TextUtils.equals(cn.getPackageName(), context.getPackageName())) { // Going to a Setting internal page, skip click logging in favor of page's own // visibility logging. Loading
tests/robotests/src/com/android/settings/core/instrumentation/MetricsFeatureProviderTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,19 @@ public class MetricsFeatureProviderTest { verifyNoMoreInteractions(mLogWriter); } @Test public void logDashboardStartIntent_intentHasNoComponent_shouldLog() { final Intent intent = new Intent(Intent.ACTION_ASSIST); mProvider.logDashboardStartIntent(mContext, intent, MetricsEvent.SETTINGS_GESTURES); verify(mLogWriter).action( eq(mContext), eq(MetricsEvent.ACTION_SETTINGS_TILE_CLICK), anyString(), eq(Pair.create(MetricsEvent.FIELD_CONTEXT, MetricsEvent.SETTINGS_GESTURES))); } @Test public void logDashboardStartIntent_intentIsExternal_shouldLog() { final Intent intent = new Intent().setComponent(new ComponentName("pkg", "cls")); Loading