[NS04.7] Reinstate a necessary change am: dd35f2dab0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1722737 Change-Id: Ia047b5757328329ceb602ce5dda7ea21e67e9255
This commit is contained in:
@@ -6640,6 +6640,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isNetworkProviderWithIdRegistered(final int providerId) {
|
||||||
|
for (final NetworkProviderInfo npi : mNetworkProviderInfos.values()) {
|
||||||
|
if (npi.providerId == providerId) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register or update a network offer.
|
* Register or update a network offer.
|
||||||
* @param newOffer The new offer. If the callback member is the same as an existing
|
* @param newOffer The new offer. If the callback member is the same as an existing
|
||||||
@@ -6647,6 +6654,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
*/
|
*/
|
||||||
private void handleRegisterNetworkOffer(@NonNull final NetworkOffer newOffer) {
|
private void handleRegisterNetworkOffer(@NonNull final NetworkOffer newOffer) {
|
||||||
ensureRunningOnConnectivityServiceThread();
|
ensureRunningOnConnectivityServiceThread();
|
||||||
|
if (!isNetworkProviderWithIdRegistered(newOffer.providerId)) {
|
||||||
|
// This may actually happen if a provider updates its score or registers and then
|
||||||
|
// immediately unregisters. The offer would still be in the handler queue, but the
|
||||||
|
// provider would have been removed.
|
||||||
|
if (DBG) log("Received offer from an unregistered provider");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final NetworkOfferInfo existingOffer = findNetworkOfferInfoByCallback(newOffer.callback);
|
final NetworkOfferInfo existingOffer = findNetworkOfferInfoByCallback(newOffer.callback);
|
||||||
if (null != existingOffer) {
|
if (null != existingOffer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user