Implement registerSystemDefaultNetworkCallback replacement in api30
In R framework, while registerSystemDefaultNetworkCallback was not available, Tethering module used a hacky way to track system default network, which is to create a NetworkRequest that is exact the same with the one in ConnectivityService. In S framework, although we have the new API to track system default network, but still need to provide backward compatibility for R devices. Thus, implement the workaround in api30 and provide unified interface to tethering. This change also use service name string to get system service, given that getSystemService(ConnectivityManager.class) cannot be mocked. Test: atest TetheringCoverageTests Bug: 185952829 Change-Id: Iaf21b6b662aa6aba79c2b75379128b8523f81f02
Loading
Please register or sign in to comment