I was looking into the network configurations in Android devices. Android makes WI-FI as the default network preference. And I noticed only one network interface can be active at a time in Android. Even ifconfig
shows both wi-fi and rmnet_data0
interfaces UP, the routing table has routing rules applied for only one interface.
The rmnet_data0
interface doesn't have RUNNING state when wi-fi is ON. Can you please point me to which file in AOSP file that this restriction implementation has been made (like register only one net_device)? In ConnectivityManager.java
file I saw that TYPE_WI-FI
was made the default interface, but I could not find how and where they register and unregister network interfaces when WI-FI is present or not.