Decrement networkRequestPerUid when callbacks are unregistered.
ConnectivityDiagnosticsCallbacks are tied to NetworkRequestInfo objects when registered with the platform. Each NetworkRequestInfo is tied to a specific uid, and ConnectivityService enforces a limit on the number of network requests that can be associated with each uid. When ConnectivityDiagnosticsCallbacks are unregistered from the platform, their NetworkRequestInfo is freed and the number of network requests per the user's uid should be decremented. Bug: 150802582 Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest Change-Id: Ia5ed39c1d8e6221cd402be4f8baf69fa643a6113
This commit is contained in:
@@ -7863,6 +7863,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Decrement the reference count for this NetworkRequestInfo. The reference count is
|
||||||
|
// incremented when the NetworkRequestInfo is created as part of
|
||||||
|
// enforceRequestCountLimit().
|
||||||
|
decrementNetworkRequestPerUidCount(nri);
|
||||||
|
|
||||||
cb.asBinder().unlinkToDeath(mConnectivityDiagnosticsCallbacks.remove(cb), 0);
|
cb.asBinder().unlinkToDeath(mConnectivityDiagnosticsCallbacks.remove(cb), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user