Log cleanup: remove unnecessary logging for suggestions

- Remove show_suggestion logging in DashboardAdapater. Showing
  suggestion is logged inside SuggestionAdapter during onBind.
- Remove hide_suggestion logging. It's not used by anyone.
- Move SuggestionLogHelper into SuggestionFeatureProvider

Bug: 65065268
Test: robotests
Change-Id: I1e7929d739b79527d2ae01c25177676f6be6ddff
This commit is contained in:
Fan Zhang
2017-10-05 17:50:14 -07:00
parent a078526920
commit 13ce220807
10 changed files with 63 additions and 442 deletions

View File

@@ -170,8 +170,7 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
if (parser == null || suggestion == null || context == null) {
return;
}
final Pair<Integer, Object>[] taggedData =
SuggestionLogHelper.getSuggestionTaggedData(isSmartSuggestionEnabled(context));
final Pair<Integer, Object>[] taggedData = getLoggingTaggedData(context);
mMetricsFeatureProvider.action(
context, MetricsEvent.ACTION_SETTINGS_DISMISS_SUGGESTION,
@@ -213,6 +212,14 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
return packageName;
}
@Override
public Pair<Integer, Object>[] getLoggingTaggedData(Context context) {
final boolean isSmartSuggestionEnabled = isSmartSuggestionEnabled(context);
return new Pair[]{Pair.create(
MetricsEvent.FIELD_SETTINGS_SMART_SUGGESTIONS_ENABLED,
isSmartSuggestionEnabled ? 1 : 0)};
}
@VisibleForTesting
boolean hasUsedNightDisplay(Context context) {
final ContentResolver cr = context.getContentResolver();