ConnectivityService: Grant networkstack uid extra privileges

The wifi network factories/agents are going to run in the network stack
process for devices which accept wifi mainline module. Allow these
factories/agents to perform privileged operations.

Bug: 142115344
Test: ACTS test
Change-Id: I2dd412ac5c6b67f52c87113fcda345e1f531f9c4
WifiNetworkRequestTest:test_connect_failure_user_rejected passes now.
(cherry-picked from c7580b1d59ee126cd6867cb6fe4485a69e2b4622)
This commit is contained in:
Roshan Pius
2019-10-04 06:33:37 -07:00
parent 464e1b5e6f
commit f1d9213e69

View File

@@ -3264,7 +3264,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
final NetworkRequestInfo nri = mNetworkRequests.get(request);
if (nri != null) {
if (Process.SYSTEM_UID != callingUid && nri.mUid != callingUid) {
if (Process.SYSTEM_UID != callingUid && Process.NETWORK_STACK_UID != callingUid
&& nri.mUid != callingUid) {
log(String.format("UID %d attempted to %s for unowned request %s",
callingUid, requestedOperation, nri));
return null;