Remove hidden connectivity methods access

This commit resolves the hidden methods accesses for
LinkProperties, IpConfiguration and RouteInfo with atlernative
way for the connectivity mainline module preparation.

Bug: 172183305
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.details2.WifiDetailPreferenceController2Test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.details.WifiDetailPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.UtilsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.WifiConfigController2Test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.WifiConfigController2Test

Change-Id: Iec4dab5d9fa12dedcf69a1cfe2a8be0956bc0d79
This commit is contained in:
Chiachang Wang
2021-03-18 15:01:03 +08:00
parent 45726b937b
commit 003e27d146
6 changed files with 33 additions and 23 deletions

View File

@@ -844,7 +844,8 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
// Find IPv4 default gateway.
String gateway = null;
for (RouteInfo routeInfo : mLinkProperties.getRoutes()) {
if (routeInfo.isIPv4Default() && routeInfo.hasGateway()) {
if (routeInfo.hasGateway() && routeInfo.isDefaultRoute()
&& routeInfo.getDestination().getAddress() instanceof Inet4Address) {
gateway = routeInfo.getGateway().getHostAddress();
break;
}