Merge changes from topic "cts-snapshots"

* changes:
  Add CTS for NetworkAgentConfig#setSubscriberId
  Add CTS for getAllNetworkStateSnapshots
  Check NETWORK_SETTINGS permission for getAllNetworkStateSnapshots
This commit is contained in:
Junyu Lai
2021-06-09 08:09:41 +00:00
committed by Gerrit Code Review
3 changed files with 101 additions and 3 deletions

View File

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