[WIFI] Make Aware + Connectivity agent network specifiers sensitive

Configure the Wi-Fi Aware and Wi-Fi connectivity API agent network
specifiers as sensitive. This will strip them out from the
network capabilities before the capabilities are forwarded to the
app.

Necessary since the agent network specifier contains information
which the apps should not have.

Bug: 122160111
Test: atest ConnectivityServiceTest (frameworks/base/tests/net)
Test: atest frameworks/base/tests/net
Test: atest frameworks/opt/net/wifi/tests/wifitests
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks/opt/net/ethernet/tests
Test: atest android.net.cts - some flakiness!
Test: act.py ThroughputTest
Test: act.py DataPathTest
Test: atest SingleDeviceTest (cts)
Change-Id: I9673107a2ee13bca63539fc7dbee7f376af3ebcb
This commit is contained in:
Etan Cohen
2018-12-30 18:00:37 -08:00
parent 3c3f264c7f
commit 753e63c0f5
2 changed files with 10 additions and 0 deletions

View File

@@ -181,4 +181,9 @@ public final class WifiNetworkAgentSpecifier extends NetworkSpecifier implements
throw new IllegalStateException("WifiNetworkAgentSpecifier should never be used "
+ "for requests.");
}
@Override
public NetworkSpecifier redact() {
return null;
}
}

View File

@@ -149,6 +149,11 @@ public class WifiAwareAgentNetworkSpecifier extends NetworkSpecifier implements
"WifiAwareAgentNetworkSpecifier should not be used in network requests");
}
@Override
public NetworkSpecifier redact() {
return null;
}
private void initialize() {
try {
mDigester = MessageDigest.getInstance("SHA-256");