Add since_visible_millis to Settings action logs.

This change adds a new action logging method on MetricsFeatureProvider
within Settings.

Uses the VisibilityLoggerMixin to calculate the elapsed time since
the fragment has been visible. Adds tagged data in
MetricsFeatureProvider#action() to store this elapsed time in
NOTIFICATION_SINCE_VISIBLE_MILLIS in MetricsEvents. Modifies the
LogWriter interface to accept variadic taggedData args in its action()
methods. Annotates the old subtype #action() methods as deprecated.

EventLogWriter also no longer casts the subtype values to strings before
sending them to MetricsLogger, so they are correctly stored as subtype
instead of package.

Bug: 65371699, 65631695
Test: make RunSettingsRoboTests
Change-Id: Iec6a61dd6a49ab237e2bdc4469fed45e89d9c380
This commit is contained in:
Eric Schwarzenbach
2017-09-14 11:09:21 -07:00
parent bfb671391d
commit 79f3476021
8 changed files with 143 additions and 15 deletions

View File

@@ -1070,7 +1070,7 @@ public class WifiSettings extends RestrictedSettingsFragment
protected void connect(final WifiConfiguration config, boolean isSavedNetwork) {
// Log subtype if configuration is a saved network.
mMetricsFeatureProvider.action(getActivity(), MetricsEvent.ACTION_WIFI_CONNECT,
mMetricsFeatureProvider.action(getVisibilityLogger(), MetricsEvent.ACTION_WIFI_CONNECT,
isSavedNetwork);
mWifiManager.connect(config, mConnectListener);
mClickedConnect = true;