Merge "Check NETWORK_SETTINGS permission for getAllNetworkStateSnapshots" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-05-20 03:59:55 +00:00
committed by Android (Google) Code Review

View File

@@ -2213,7 +2213,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
@NonNull @NonNull
public List<NetworkStateSnapshot> getAllNetworkStateSnapshots() { public List<NetworkStateSnapshot> getAllNetworkStateSnapshots() {
// This contains IMSI details, so make sure the caller is privileged. // This contains IMSI details, so make sure the caller is privileged.
PermissionUtils.enforceNetworkStackPermission(mContext); enforceNetworkStackOrSettingsPermission();
final ArrayList<NetworkStateSnapshot> result = new ArrayList<>(); final ArrayList<NetworkStateSnapshot> result = new ArrayList<>();
for (Network network : getAllNetworks()) { for (Network network : getAllNetworks()) {