Merge "Use ACCESS_WIFI_STATE when clearing wifi blacklist" am: f5ae03550a am: 85dfa5cae0 am: 531e6b8080

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1490016

Change-Id: I40dfb1caa6169dcd6ecb33c9f582603d2037bee7
This commit is contained in:
Treehugger Robot
2020-11-12 06:46:25 +00:00
committed by Automerger Merge Worker

View File

@@ -16,6 +16,7 @@
package android.net.cts.util;
import static android.Manifest.permission.ACCESS_WIFI_STATE;
import static android.Manifest.permission.NETWORK_SETTINGS;
import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_OPPORTUNISTIC;
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
@@ -331,7 +332,7 @@ public final class CtsNetUtils {
* to them.
*/
private void clearWifiBlacklist() {
runAsShell(NETWORK_SETTINGS, () -> {
runAsShell(NETWORK_SETTINGS, ACCESS_WIFI_STATE, () -> {
for (WifiConfiguration cfg : mWifiManager.getConfiguredNetworks()) {
assertTrue(mWifiManager.enableNetwork(cfg.networkId, false /* attemptConnect */));
}