Fix a bug where a request would not be refcounted

This ends up crashing the system when the request
is unregistered, because the ref counter finds the
count associated with the relevant UID is zero.

Test: FrameworksNetTests
Test: TODO : this needs a new unit test
Change-Id: I0ee0ce925a826d35d8fd58cefb8a870e98ce9add
This commit is contained in:
Chalard Jean
2021-03-01 22:12:56 +09:00
parent 06985411b7
commit b80f9b0097

View File

@@ -5259,6 +5259,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
mPid = nri.mPid;
mUid = nri.mUid;
mPendingIntent = nri.mPendingIntent;
mNetworkRequestCounter.incrementCountOrThrow(mUid);
mCallingAttributionTag = nri.mCallingAttributionTag;
}