Fix NetworkOffer Death link does not exist
unregisterNetworkProvider is being called from binderDied() and handleUnregisterNetworkProvider() at the same time. This results in NoSuchElementException being thrown. Check than noi can be removed from network offers before unregistering death link. Bug: 196423150 Change-Id: If5bd5f2894fa0509a89340efdc85180c54e72e0e
This commit is contained in:
parent
c80a5d56db
commit
3ec7e6d9fb
1 changed files with 5 additions and 1 deletions
|
|
@ -6901,7 +6901,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
if (DBG) {
|
||||
log("unregister offer from providerId " + noi.offer.providerId + " : " + noi.offer);
|
||||
}
|
||||
mNetworkOffers.remove(noi);
|
||||
|
||||
// If the provider removes the offer and dies immediately afterwards this
|
||||
// function may be called twice in a row, but the array will no longer contain
|
||||
// the offer.
|
||||
if (!mNetworkOffers.remove(noi)) return;
|
||||
noi.offer.callback.asBinder().unlinkToDeath(noi, 0 /* flags */);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue