summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2021-03-16 18:25:06 +0900
committerRemi NGUYEN VAN <reminv@google.com>2021-03-17 01:21:37 +0000
commitcd06f06a463acfabc931dfa8371a48f0d36138db (patch)
treeb160721d03b5b41210a8c53821b0c0161cd60a83
parent404104c7e8583bdc9f6191b770efe504521169ea (diff)
downloadframeworks_opt_net_wifi-cd06f06a463acfabc931dfa8371a48f0d36138db.tar.gz
frameworks_opt_net_wifi-cd06f06a463acfabc931dfa8371a48f0d36138db.tar.bz2
frameworks_opt_net_wifi-cd06f06a463acfabc931dfa8371a48f0d36138db.zip
Remove WifiEntry usage of hidden connectivity API
RouteInfo.isIPv4Default is a hidden symbol, the supported way to check the same is to use isDefaultRoute, and verify that the address is IPv4. Bug: 182859030 Test: m WifiTrackerLib Merged-In: Iba2efd80623e01d22a37980f2c7453cdac37b562 Change-Id: Ia9c6a5e27e6166264a65af4075f1697521542e8c
-rw-r--r--libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java
index 09a2a3ffe..982ef888a 100644
--- a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java
+++ b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java
@@ -703,7 +703,8 @@ public abstract class WifiEntry implements Comparable<WifiEntry> {
// Find IPv4 default gateway.
for (RouteInfo routeInfo : linkProperties.getRoutes()) {
- if (routeInfo.isIPv4Default() && routeInfo.hasGateway()) {
+ if (routeInfo.isDefaultRoute() && routeInfo.getDestination().getAddress()
+ instanceof Inet4Address && routeInfo.hasGateway()) {
mConnectedInfo.gateway = routeInfo.getGateway().getHostAddress();
break;
}