Merge "Partially enforce permission when calling getNetworkInfoForUid"

This commit is contained in:
Treehugger Robot 2022-10-07 04:38:30 +00:00 • committed by Gerrit Code Review
commit d577c39663

View file

@ -1982,6 +1982,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
@Nullable
public NetworkInfo getNetworkInfoForUid(Network network, int uid, boolean ignoreBlocked) {
enforceAccessPermission();
if (uid != mDeps.getCallingUid()) {
enforceNetworkStackPermission(mContext);
}
final NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(network);
if (nai == null) return null;
return getFilteredNetworkInfo(nai, uid, ignoreBlocked);