Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2be16e6f authored by junyulai's avatar junyulai
Browse files

Check NETWORK_SETTINGS permission for getAllNetworkStateSnapshots

This is declared in the API surface, but the implementation
does not match.

Ignore-AOSP-First: Needs cherry-picks
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testGetAllNetworkStateSnapshots
Bug: 188140631
Change-Id: I97aa69651461ebe5c323ec669372f9a61b84e6a6
parent e1645d0c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2210,7 +2210,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()) {