From f22e8c4c2e81e499ea542c272c1cc1cfee94452e Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Thu, 26 Mar 2015 13:34:02 -0400 Subject: log wifi actions from settings To start: enable disable forget connect add Depends-On: I60163e44602b8e23b643b9103c324fa0e0d2c4c4 Change-Id: I52f40298db63f410ced2dbf5ba05d3ad098a85a2 --- src/com/android/settings/wifi/WifiEnabler.java | 4 +++- src/com/android/settings/wifi/WifiSettings.java | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/com') diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java index 754dbaa26..fe52cf241 100644 --- a/src/com/android/settings/wifi/WifiEnabler.java +++ b/src/com/android/settings/wifi/WifiEnabler.java @@ -30,6 +30,7 @@ import android.provider.Settings; import android.widget.Switch; import android.widget.Toast; +import com.android.internal.logging.MetricsLogger; import com.android.settings.R; import com.android.settings.search.Index; import com.android.settings.widget.SwitchBar; @@ -209,7 +210,8 @@ public class WifiEnabler implements SwitchBar.OnSwitchChangeListener { (wifiApState == WifiManager.WIFI_AP_STATE_ENABLED))) { mWifiManager.setWifiApEnabled(null, false); } - + MetricsLogger.action(mContext, + isChecked ? MetricsLogger.ACTION_WIFI_ON : MetricsLogger.ACTION_WIFI_OFF); if (!mWifiManager.setWifiEnabled(isChecked)) { // Error mSwitchBar.setEnabled(true); diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index 0d0462295..238db6943 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -369,6 +369,7 @@ public class WifiSettings extends RestrictedSettingsFragment showDialog(WPS_PIN_DIALOG_ID); return true; case MENU_ID_SCAN: + MetricsLogger.action(getActivity(), MetricsLogger.ACTION_WIFI_FORCE_SCAN); mWifiTracker.forceScan(); return true; case MENU_ID_ADD_NETWORK: @@ -707,6 +708,7 @@ public class WifiSettings extends RestrictedSettingsFragment } /* package */ void forget() { + MetricsLogger.action(getActivity(), MetricsLogger.ACTION_WIFI_FORGET); if (!mSelectedAccessPoint.isSaved()) { if (mSelectedAccessPoint.getNetworkInfo().getState() != State.DISCONNECTED) { // Network is active but has no network ID - must be ephemeral. @@ -728,10 +730,12 @@ public class WifiSettings extends RestrictedSettingsFragment } protected void connect(final WifiConfiguration config) { + MetricsLogger.action(getActivity(), MetricsLogger.ACTION_WIFI_CONNECT); mWifiManager.connect(config, mConnectListener); } protected void connect(final int networkId) { + MetricsLogger.action(getActivity(), MetricsLogger.ACTION_WIFI_CONNECT); mWifiManager.connect(networkId, mConnectListener); } @@ -748,6 +752,7 @@ public class WifiSettings extends RestrictedSettingsFragment * Called when "add network" button is pressed. */ /* package */ void onAddNetworkPressed() { + MetricsLogger.action(getActivity(), MetricsLogger.ACTION_WIFI_ADD_NETWORK); // No exact access point is selected. mSelectedAccessPoint = null; showDialog(null, true); -- cgit v1.2.3