Move EthernetNetworkFactory to using the NetworkProvider API
This CL makes EthernetNetworkFactory inherit from NetworkProvider rather than NetworkFactory. The name of the class is purposefully unchanged to make the code review easier (it will be changed to EthernetNetworkProvider in a follow up). As part of the conversion, NetworkInterfaceState now registers a NetworkOffer when the link comes up and unregisters it when the link goes down. It updates the existing offer when capabilities change (by calling registerNetworkOffer with an already registered NetworkOfferCallback). This change should fix existing refCount issues. When a NetworkOffer is first registered, it receives callbacks for all existing requests. This is the main problem with the NetworkFactory implementation where only one NetworkOffer is registered when the factory is first created; so when interfaces come up, they do not receive callbacks for existing requests. Test: atest EthernetNetworkTest Bug: 197548738 Change-Id: I5e8e4673d2ed04bc1a0c8d232a8772edfff65b5d
Loading
Please register or sign in to comment