Log source with visibility change

- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
This commit is contained in:
Fan Zhang
2017-02-14 15:02:35 -08:00
parent 358eab0fff
commit c6ca314c0b
64 changed files with 347 additions and 215 deletions

View File

@@ -17,6 +17,8 @@ package com.android.settings.applications;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
@@ -42,6 +44,6 @@ public class ShortcutPreference extends Preference {
Bundle bundle = new Bundle();
bundle.putString(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, mPrefKey);
Utils.startWithFragment(getContext(), mTarget.getName(), bundle, null, 0,
mTitle, null);
mTitle, null, MetricsProto.MetricsEvent.VIEW_UNKNOWN);
}
}