Loading services/core/java/com/android/server/ConnectivityService.java +16 −14 Original line number Diff line number Diff line Loading @@ -4038,7 +4038,7 @@ public class ConnectivityService extends IConnectivityManager.Stub } } } decrementRequestCount(nri); nri.decrementRequestCount(); mNetworkRequestInfoLogs.log("RELEASE " + nri); if (null != nri.getActiveRequest()) { Loading Loading @@ -4155,14 +4155,6 @@ public class ConnectivityService extends IConnectivityManager.Stub ? mSystemNetworkRequestCounter : mNetworkRequestCounter; } private void incrementRequestCountOrThrow(NetworkRequestInfo nri) { getRequestCounter(nri).incrementCountOrThrow(nri.mUid); } private void decrementRequestCount(NetworkRequestInfo nri) { getRequestCounter(nri).decrementCount(nri.mUid); } @Override public void setAcceptUnvalidated(Network network, boolean accept, boolean always) { enforceNetworkStackSettingsOrSetup(); Loading Loading @@ -5461,6 +5453,9 @@ public class ConnectivityService extends IConnectivityManager.Stub @Nullable final String mCallingAttributionTag; // Counter keeping track of this NRI. final PerUidCounter mPerUidCounter; // Effective UID of this request. This is different from mUid when a privileged process // files a request on behalf of another UID. This UID is used to determine blocked status, // UID matching, and so on. mUid above is used for permission checks and to enforce the Loading Loading @@ -5511,7 +5506,8 @@ public class ConnectivityService extends IConnectivityManager.Stub mPid = getCallingPid(); mUid = mDeps.getCallingUid(); mAsUid = asUid; incrementRequestCountOrThrow(this); mPerUidCounter = getRequestCounter(this); mPerUidCounter.incrementCountOrThrow(mUid); /** * Location sensitive data not included in pending intent. Only included in * {@link NetworkCallback}. Loading Loading @@ -5543,7 +5539,8 @@ public class ConnectivityService extends IConnectivityManager.Stub mUid = mDeps.getCallingUid(); mAsUid = asUid; mPendingIntent = null; incrementRequestCountOrThrow(this); mPerUidCounter = getRequestCounter(this); mPerUidCounter.incrementCountOrThrow(mUid); mCallbackFlags = callbackFlags; mCallingAttributionTag = callingAttributionTag; linkDeathRecipient(); Loading Loading @@ -5581,7 +5578,8 @@ public class ConnectivityService extends IConnectivityManager.Stub mUid = nri.mUid; mAsUid = nri.mAsUid; mPendingIntent = nri.mPendingIntent; incrementRequestCountOrThrow(this); mPerUidCounter = getRequestCounter(this); mPerUidCounter.incrementCountOrThrow(mUid); mCallbackFlags = nri.mCallbackFlags; mCallingAttributionTag = nri.mCallingAttributionTag; linkDeathRecipient(); Loading Loading @@ -5613,6 +5611,10 @@ public class ConnectivityService extends IConnectivityManager.Stub return Collections.unmodifiableList(tempRequests); } void decrementRequestCount() { mPerUidCounter.decrementCount(mUid); } void linkDeathRecipient() { if (null != mBinder) { try { Loading Loading @@ -8781,7 +8783,7 @@ public class ConnectivityService extends IConnectivityManager.Stub // Decrement the reference count for this NetworkRequestInfo. The reference count is // incremented when the NetworkRequestInfo is created as part of // enforceRequestCountLimit(). decrementRequestCount(nri); nri.decrementRequestCount(); return; } Loading Loading @@ -8847,7 +8849,7 @@ public class ConnectivityService extends IConnectivityManager.Stub // Decrement the reference count for this NetworkRequestInfo. The reference count is // incremented when the NetworkRequestInfo is created as part of // enforceRequestCountLimit(). decrementRequestCount(nri); nri.decrementRequestCount(); iCb.unlinkToDeath(cbInfo, 0); } Loading Loading
services/core/java/com/android/server/ConnectivityService.java +16 −14 Original line number Diff line number Diff line Loading @@ -4038,7 +4038,7 @@ public class ConnectivityService extends IConnectivityManager.Stub } } } decrementRequestCount(nri); nri.decrementRequestCount(); mNetworkRequestInfoLogs.log("RELEASE " + nri); if (null != nri.getActiveRequest()) { Loading Loading @@ -4155,14 +4155,6 @@ public class ConnectivityService extends IConnectivityManager.Stub ? mSystemNetworkRequestCounter : mNetworkRequestCounter; } private void incrementRequestCountOrThrow(NetworkRequestInfo nri) { getRequestCounter(nri).incrementCountOrThrow(nri.mUid); } private void decrementRequestCount(NetworkRequestInfo nri) { getRequestCounter(nri).decrementCount(nri.mUid); } @Override public void setAcceptUnvalidated(Network network, boolean accept, boolean always) { enforceNetworkStackSettingsOrSetup(); Loading Loading @@ -5461,6 +5453,9 @@ public class ConnectivityService extends IConnectivityManager.Stub @Nullable final String mCallingAttributionTag; // Counter keeping track of this NRI. final PerUidCounter mPerUidCounter; // Effective UID of this request. This is different from mUid when a privileged process // files a request on behalf of another UID. This UID is used to determine blocked status, // UID matching, and so on. mUid above is used for permission checks and to enforce the Loading Loading @@ -5511,7 +5506,8 @@ public class ConnectivityService extends IConnectivityManager.Stub mPid = getCallingPid(); mUid = mDeps.getCallingUid(); mAsUid = asUid; incrementRequestCountOrThrow(this); mPerUidCounter = getRequestCounter(this); mPerUidCounter.incrementCountOrThrow(mUid); /** * Location sensitive data not included in pending intent. Only included in * {@link NetworkCallback}. Loading Loading @@ -5543,7 +5539,8 @@ public class ConnectivityService extends IConnectivityManager.Stub mUid = mDeps.getCallingUid(); mAsUid = asUid; mPendingIntent = null; incrementRequestCountOrThrow(this); mPerUidCounter = getRequestCounter(this); mPerUidCounter.incrementCountOrThrow(mUid); mCallbackFlags = callbackFlags; mCallingAttributionTag = callingAttributionTag; linkDeathRecipient(); Loading Loading @@ -5581,7 +5578,8 @@ public class ConnectivityService extends IConnectivityManager.Stub mUid = nri.mUid; mAsUid = nri.mAsUid; mPendingIntent = nri.mPendingIntent; incrementRequestCountOrThrow(this); mPerUidCounter = getRequestCounter(this); mPerUidCounter.incrementCountOrThrow(mUid); mCallbackFlags = nri.mCallbackFlags; mCallingAttributionTag = nri.mCallingAttributionTag; linkDeathRecipient(); Loading Loading @@ -5613,6 +5611,10 @@ public class ConnectivityService extends IConnectivityManager.Stub return Collections.unmodifiableList(tempRequests); } void decrementRequestCount() { mPerUidCounter.decrementCount(mUid); } void linkDeathRecipient() { if (null != mBinder) { try { Loading Loading @@ -8781,7 +8783,7 @@ public class ConnectivityService extends IConnectivityManager.Stub // Decrement the reference count for this NetworkRequestInfo. The reference count is // incremented when the NetworkRequestInfo is created as part of // enforceRequestCountLimit(). decrementRequestCount(nri); nri.decrementRequestCount(); return; } Loading Loading @@ -8847,7 +8849,7 @@ public class ConnectivityService extends IConnectivityManager.Stub // Decrement the reference count for this NetworkRequestInfo. The reference count is // incremented when the NetworkRequestInfo is created as part of // enforceRequestCountLimit(). decrementRequestCount(nri); nri.decrementRequestCount(); iCb.unlinkToDeath(cbInfo, 0); } Loading