summaryrefslogtreecommitdiff
path: root/wifi/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2020-01-16 12:17:17 -0800
committerBenedict Wong <benedictwong@google.com>2020-02-19 23:12:32 +0000
commitb2e49ac48bf81065443c84b094650cafbf6b8f53 (patch)
tree93ca0aa5326651c44270c8523e45e02157c5491d /wifi/tests
parent329d286b88ea3d14ed00ef93b72841682d11fcf4 (diff)
DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName
Add the requestorUid & requestorPackageName fields to NetworkCapabilities. This is populated by CS when a new network request is received. These 2 requestor fields are also optionally used for network matching. All of the regular app initiated requests will have the requestor uid and package name set by connectivity service. Network agents can optionally set the requestorUid and requestorPackageName to restrict the network created only to the app that requested the network. This will help removing the necessity for the various specifiers to embed the uid & package name info in the specifier for network matching. Note: NetworkSpecifier.assertValidFromUid() is deprecated & removed in favor of setting the uid/package name on the agent to restrict the network to a certain app (useful for wifi peer to peer API & wifi aware). Bug: 144102365 Test: Verified that wifi network request related CTS verifier tests pass. Test: Device boots up and connects to wifi networks Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529 Change-Id: I58775e82aa7725aac5aa27ca9d2b5ee8f0be4242
Diffstat (limited to 'wifi/tests')
-rw-r--r--wifi/tests/src/android/net/wifi/WifiNetworkAgentSpecifierTest.java10
-rw-r--r--wifi/tests/src/android/net/wifi/aware/WifiAwareAgentNetworkSpecifierTest.java11
2 files changed, 0 insertions, 21 deletions
diff --git a/wifi/tests/src/android/net/wifi/WifiNetworkAgentSpecifierTest.java b/wifi/tests/src/android/net/wifi/WifiNetworkAgentSpecifierTest.java
index e6eece85cb19..38040ea08eba 100644
--- a/wifi/tests/src/android/net/wifi/WifiNetworkAgentSpecifierTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiNetworkAgentSpecifierTest.java
@@ -71,16 +71,6 @@ public class WifiNetworkAgentSpecifierTest {
}
/**
- * Validate that the NetworkAgentSpecifier cannot be used in a {@link NetworkRequest} by apps.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkAgentSpecifierNotUsedInNetworkRequest() {
- WifiNetworkAgentSpecifier specifier = createDefaultNetworkAgentSpecifier();
-
- specifier.assertValidFromUid(TEST_UID);
- }
-
- /**
* Validate NetworkAgentSpecifier equals with itself.
* a) Create network agent specifier 1 for WPA_PSK network
* b) Create network agent specifier 2 with the same params as specifier 1.
diff --git a/wifi/tests/src/android/net/wifi/aware/WifiAwareAgentNetworkSpecifierTest.java b/wifi/tests/src/android/net/wifi/aware/WifiAwareAgentNetworkSpecifierTest.java
index c3b62854f12c..ef9c6a389db7 100644
--- a/wifi/tests/src/android/net/wifi/aware/WifiAwareAgentNetworkSpecifierTest.java
+++ b/wifi/tests/src/android/net/wifi/aware/WifiAwareAgentNetworkSpecifierTest.java
@@ -162,17 +162,6 @@ public class WifiAwareAgentNetworkSpecifierTest {
collector.checkThat("Match unexpected", oldNs.satisfiedBy(newNs), equalTo(false));
}
- /**
- * Validate that agent network specifier cannot be used as in network requests - i.e. that
- * throws an exception when queried for UID validity.
- */
- @Test(expected = SecurityException.class)
- public void testNoUsageInRequest() {
- WifiAwareAgentNetworkSpecifier dut = new WifiAwareAgentNetworkSpecifier();
-
- dut.assertValidFromUid(0);
- }
-
// utilities
/**