Use NetworkInterface API to retrieve interface list in EthernetTracker
Currently EthernetTracker uses netd to interact with interfaces, such as
retrieving all interfaces, updating interface configurations etc.
However, the usage of netd can bring some unexpected side effects, such
as clearing v4 address when toggling on/off interface.
This change moves forward with one less usage of netd to use
NetworkInterface.getNetworkInterfaces() to directly retrieve interface
list in EthernetTracker and added test to test the interface list can be
retrieved successfully when ethernet is disabled.
Bug: 379021505
Test: atest EthernetManager
Change-Id: I32f285a62f8f62180043052dd8790eed419dd226
3 files changed