summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNate Jiang <qiangjiang@google.com>2020-05-06 15:38:17 -0700
committerNate Jiang <qiangjiang@google.com>2020-05-07 16:49:09 -0700
commitb33fae243570a1934a03ca37ed6293120b4daf54 (patch)
tree46969179b7a8ba59957f715bbcb9ee9e49cff818 /tests
parent431a8ab0ac838e332d43d4264b58d97cae3b7732 (diff)
Add metrics for user revoke permission
Revoke permission can happen when user disable in settings or user disallowed from UI. Updated-PDD: TRUE Bug: 154546365 Test: atest com.android.server.wifi Change-Id: I76f0935867dc8a58ede0e1967b1629861e97a6ea
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java6
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java1
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
index 6506bd8d2..5b73f7a08 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -4180,6 +4180,9 @@ public class WifiMetricsTest extends WifiBaseTest {
mWifiMetrics.addNetworkSuggestionUserApprovalAppUiReaction(1, true);
mWifiMetrics.addNetworkSuggestionUserApprovalAppUiReaction(2, false);
+ mWifiMetrics.incrementNetworkSuggestionUserRevokePermission();
+ mWifiMetrics.incrementNetworkSuggestionUserRevokePermission();
+
dumpProtoAndDeserialize();
assertEquals(4, mDecodedProto.wifiNetworkSuggestionApiLog.numModification);
@@ -4220,6 +4223,9 @@ public class WifiMetricsTest extends WifiBaseTest {
assertEquals(false,
mDecodedProto.wifiNetworkSuggestionApiLog.userApprovalAppUiReaction[1]
.isDialog);
+
+ assertEquals(2, mDecodedProto.wifiNetworkSuggestionApiLog
+ .userRevokeAppSuggestionPermission);
}
private NetworkSelectionExperimentDecisions findUniqueNetworkSelectionExperimentDecisions(
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java
index df729bfb1..1bfe20bfe 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java
@@ -2040,6 +2040,7 @@ public class WifiNetworkSuggestionsManagerTest extends WifiBaseTest {
mLooper.dispatchAll();
verify(mAppOpsManager).stopWatchingMode(mAppOpChangedListenerCaptor.getValue());
assertTrue(mWifiNetworkSuggestionsManager.getAllNetworkSuggestions().isEmpty());
+ verify(mWifiMetrics).incrementNetworkSuggestionUserRevokePermission();
}
/**