Merge "Fix broken testCaptivePortalApp" am: 47f5317b65 am: 5001e88f0e am: 9653e0cd80
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1659999 Change-Id: I015c98915193a28d3b53b309b38479247346519b
This commit is contained in:
@@ -4056,7 +4056,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decrementRequestCount(nri);
|
nri.decrementRequestCount();
|
||||||
mNetworkRequestInfoLogs.log("RELEASE " + nri);
|
mNetworkRequestInfoLogs.log("RELEASE " + nri);
|
||||||
|
|
||||||
if (null != nri.getActiveRequest()) {
|
if (null != nri.getActiveRequest()) {
|
||||||
@@ -4167,14 +4167,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
? mSystemNetworkRequestCounter : mNetworkRequestCounter;
|
? mSystemNetworkRequestCounter : mNetworkRequestCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void incrementRequestCountOrThrow(NetworkRequestInfo nri) {
|
|
||||||
getRequestCounter(nri).incrementCountOrThrow(nri.mUid);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void decrementRequestCount(NetworkRequestInfo nri) {
|
|
||||||
getRequestCounter(nri).decrementCount(nri.mUid);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAcceptUnvalidated(Network network, boolean accept, boolean always) {
|
public void setAcceptUnvalidated(Network network, boolean accept, boolean always) {
|
||||||
enforceNetworkStackSettingsOrSetup();
|
enforceNetworkStackSettingsOrSetup();
|
||||||
@@ -5462,6 +5454,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
@Nullable
|
@Nullable
|
||||||
final String mCallingAttributionTag;
|
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
|
// 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,
|
// 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
|
// UID matching, and so on. mUid above is used for permission checks and to enforce the
|
||||||
@@ -5512,7 +5507,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
mPid = getCallingPid();
|
mPid = getCallingPid();
|
||||||
mUid = mDeps.getCallingUid();
|
mUid = mDeps.getCallingUid();
|
||||||
mAsUid = asUid;
|
mAsUid = asUid;
|
||||||
incrementRequestCountOrThrow(this);
|
mPerUidCounter = getRequestCounter(this);
|
||||||
|
mPerUidCounter.incrementCountOrThrow(mUid);
|
||||||
/**
|
/**
|
||||||
* Location sensitive data not included in pending intent. Only included in
|
* Location sensitive data not included in pending intent. Only included in
|
||||||
* {@link NetworkCallback}.
|
* {@link NetworkCallback}.
|
||||||
@@ -5544,7 +5540,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
mUid = mDeps.getCallingUid();
|
mUid = mDeps.getCallingUid();
|
||||||
mAsUid = asUid;
|
mAsUid = asUid;
|
||||||
mPendingIntent = null;
|
mPendingIntent = null;
|
||||||
incrementRequestCountOrThrow(this);
|
mPerUidCounter = getRequestCounter(this);
|
||||||
|
mPerUidCounter.incrementCountOrThrow(mUid);
|
||||||
mCallbackFlags = callbackFlags;
|
mCallbackFlags = callbackFlags;
|
||||||
mCallingAttributionTag = callingAttributionTag;
|
mCallingAttributionTag = callingAttributionTag;
|
||||||
linkDeathRecipient();
|
linkDeathRecipient();
|
||||||
@@ -5582,7 +5579,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
mUid = nri.mUid;
|
mUid = nri.mUid;
|
||||||
mAsUid = nri.mAsUid;
|
mAsUid = nri.mAsUid;
|
||||||
mPendingIntent = nri.mPendingIntent;
|
mPendingIntent = nri.mPendingIntent;
|
||||||
incrementRequestCountOrThrow(this);
|
mPerUidCounter = getRequestCounter(this);
|
||||||
|
mPerUidCounter.incrementCountOrThrow(mUid);
|
||||||
mCallbackFlags = nri.mCallbackFlags;
|
mCallbackFlags = nri.mCallbackFlags;
|
||||||
mCallingAttributionTag = nri.mCallingAttributionTag;
|
mCallingAttributionTag = nri.mCallingAttributionTag;
|
||||||
linkDeathRecipient();
|
linkDeathRecipient();
|
||||||
@@ -5614,6 +5612,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
return Collections.unmodifiableList(tempRequests);
|
return Collections.unmodifiableList(tempRequests);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void decrementRequestCount() {
|
||||||
|
mPerUidCounter.decrementCount(mUid);
|
||||||
|
}
|
||||||
|
|
||||||
void linkDeathRecipient() {
|
void linkDeathRecipient() {
|
||||||
if (null != mBinder) {
|
if (null != mBinder) {
|
||||||
try {
|
try {
|
||||||
@@ -8883,7 +8885,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
// Decrement the reference count for this NetworkRequestInfo. The reference count is
|
// Decrement the reference count for this NetworkRequestInfo. The reference count is
|
||||||
// incremented when the NetworkRequestInfo is created as part of
|
// incremented when the NetworkRequestInfo is created as part of
|
||||||
// enforceRequestCountLimit().
|
// enforceRequestCountLimit().
|
||||||
decrementRequestCount(nri);
|
nri.decrementRequestCount();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8949,7 +8951,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
// Decrement the reference count for this NetworkRequestInfo. The reference count is
|
// Decrement the reference count for this NetworkRequestInfo. The reference count is
|
||||||
// incremented when the NetworkRequestInfo is created as part of
|
// incremented when the NetworkRequestInfo is created as part of
|
||||||
// enforceRequestCountLimit().
|
// enforceRequestCountLimit().
|
||||||
decrementRequestCount(nri);
|
nri.decrementRequestCount();
|
||||||
|
|
||||||
iCb.unlinkToDeath(cbInfo, 0);
|
iCb.unlinkToDeath(cbInfo, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user