Add subtypes to tron logging for Wifi toggles.

For ACTION_WIFI_CONNECT, added subtype to specify whether user is
connecting to saved network.
For ACTION_WIFI_OFF, added subtype to specify whether user was connected
to a network at the time.

Bug: 32371451
Change-Id: I1d4445bda2fbeb062831e6f858ccc711bff65105
Fixes: 32371451
Test: Verify logs by running:
adb logcat -b events | egrep '(sysui_|notification_)'
This commit is contained in:
Stephen Chen
2016-10-31 12:59:41 -07:00
parent 80d1ec7dee
commit d9e2c946af
3 changed files with 26 additions and 16 deletions

View File

@@ -231,8 +231,13 @@ public class WifiEnabler implements SwitchBar.OnSwitchChangeListener {
if (mayDisableTethering(isChecked)) {
mWifiManager.setWifiApEnabled(null, false);
}
mMetricsFeatureProvider.action(mContext,
isChecked ? MetricsEvent.ACTION_WIFI_ON : MetricsEvent.ACTION_WIFI_OFF);
if (isChecked) {
mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_WIFI_ON);
} else {
// Log if user was connected at the time of switching off.
mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_WIFI_OFF,
mConnected.get());
}
if (!mWifiManager.setWifiEnabled(isChecked)) {
// Error
mSwitchBar.setEnabled(true);