Merge "Use ACCESS_WIFI_STATE when clearing wifi blacklist" into mainline-prod

This commit is contained in:
TreeHugger Robot
2021-02-02 07:38:55 +00:00
committed by Android (Google) Code Review

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 */));
}