summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorOscar Shu <xshu@google.com>2020-04-24 02:01:38 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-24 02:01:38 +0000
commit55a505a17c672dfb161ed7ab1cf29e8a1bd5052d (patch)
tree57adbe64302a0da20de80fa4c7b161fed593391a /service
parent1f64a4ffb49d252fd32e18a67ad17fb780420368 (diff)
parentcb3068db3169ab2c9645683fd7b5baeae1db7c7d (diff)
Merge "Settings toggle value metrics" into rvc-dev am: 964bd5d117 am: cb3068db31
Change-Id: I69b8892f41201a68de79785eb77639d20ef57005
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java22
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java28
-rw-r--r--service/proto/src/metrics.proto6
3 files changed, 46 insertions, 10 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index f11a7f139..883203d2c 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -1744,6 +1744,24 @@ public class WifiMetrics {
}
/**
+ * Developer options toggle value for verbose logging.
+ */
+ public void setVerboseLoggingEnabled(boolean enabled) {
+ synchronized (mLock) {
+ mWifiLogProto.isVerboseLoggingEnabled = enabled;
+ }
+ }
+
+ /**
+ * Developer options toggle value for enhanced MAC randomization.
+ */
+ public void setEnhancedMacRandomizationForceEnabled(boolean enabled) {
+ synchronized (mLock) {
+ mWifiLogProto.isEnhancedMacRandomizationForceEnabled = enabled;
+ }
+ }
+
+ /**
* Increment Non Empty Scan Results count
*/
public void incrementNonEmptyScanResultCount() {
@@ -3107,6 +3125,10 @@ public class WifiMetrics {
pw.println("mWifiLogProto.isLocationEnabled=" + mWifiLogProto.isLocationEnabled);
pw.println("mWifiLogProto.isScanningAlwaysEnabled="
+ mWifiLogProto.isScanningAlwaysEnabled);
+ pw.println("mWifiLogProto.isVerboseLoggingEnabled="
+ + mWifiLogProto.isVerboseLoggingEnabled);
+ pw.println("mWifiLogProto.isEnhancedMacRandomizationForceEnabled="
+ + mWifiLogProto.isEnhancedMacRandomizationForceEnabled);
pw.println("mWifiLogProto.numNetworksAddedByUser="
+ mWifiLogProto.numNetworksAddedByUser);
pw.println("mWifiLogProto.numNetworksAddedByApps="
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index 37f34639e..ac6f7fb63 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -3180,6 +3180,20 @@ public class WifiServiceImpl extends BaseWifiService {
args);
}
+ private void updateWifiMetrics() {
+ mWifiThreadRunner.run(() -> {
+ mWifiMetrics.updateSavedNetworks(
+ mWifiConfigManager.getSavedNetworks(Process.WIFI_UID));
+ mPasspointManager.updateMetrics();
+ });
+ boolean isEnhancedMacRandEnabled = mFrameworkFacade.getIntegerSetting(mContext,
+ WifiConfigManager.ENHANCED_MAC_RANDOMIZATION_FEATURE_FORCE_ENABLE_FLAG, 0) == 1
+ ? true : false;
+ mWifiMetrics.setEnhancedMacRandomizationForceEnabled(isEnhancedMacRandEnabled);
+ mWifiMetrics.setIsScanningAlwaysEnabled(isScanAlwaysAvailable());
+ mWifiMetrics.setVerboseLoggingEnabled(mVerboseLoggingEnabled);
+ }
+
@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
@@ -3191,11 +3205,7 @@ public class WifiServiceImpl extends BaseWifiService {
}
if (args != null && args.length > 0 && WifiMetrics.PROTO_DUMP_ARG.equals(args[0])) {
// WifiMetrics proto bytes were requested. Dump only these.
- mWifiThreadRunner.run(() -> {
- mWifiMetrics.updateSavedNetworks(
- mWifiConfigManager.getSavedNetworks(Process.WIFI_UID));
- mPasspointManager.updateMetrics();
- });
+ updateWifiMetrics();
mWifiMetrics.dump(fd, pw, args);
} else if (args != null && args.length > 0 && IpClientUtil.DUMP_ARG.equals(args[0])) {
// IpClient dump was requested. Pass it along and take no further action.
@@ -3238,12 +3248,10 @@ public class WifiServiceImpl extends BaseWifiService {
wifiScoreCard.getNetworkListBase64(true), "");
pw.println("WifiScoreCard:");
pw.println(networkListBase64);
- mWifiThreadRunner.run(() -> {
- mWifiMetrics.updateSavedNetworks(
- mWifiConfigManager.getSavedNetworks(Process.WIFI_UID));
- mPasspointManager.updateMetrics();
- });
+
+ updateWifiMetrics();
mWifiMetrics.dump(fd, pw, args);
+
pw.println();
mWifiThreadRunner.run(() -> mWifiNetworkSuggestionsManager.dump(fd, pw, args));
pw.println();
diff --git a/service/proto/src/metrics.proto b/service/proto/src/metrics.proto
index 669dd2e32..2a8455235 100644
--- a/service/proto/src/metrics.proto
+++ b/service/proto/src/metrics.proto
@@ -687,6 +687,12 @@ message WifiLog {
// List of user initiated actions
repeated UserActionEvent user_action_events = 192;
+
+ // Does the user have wifi verbose logging enabled.
+ optional bool is_verbose_logging_enabled = 193;
+
+ // Does the user have enhanced MAC randomization forced to on.
+ optional bool is_enhanced_mac_randomization_force_enabled = 194;
}
// Information that gets logged for every WiFi connection.