Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b248125d authored by Paul Hu's avatar Paul Hu Committed by Automerger Merge Worker
Browse files

Merge "Replace Inet[4|6]Address#ANY" am: ab70e793 am: 046574ec

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615184

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9ee00807430cd27ed1632a0a6f7c78ab0ae4a99f
parents 8067a74a 046574ec
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.os.Parcel;
import android.os.Parcelable;

import com.android.net.module.util.NetUtils;
import com.android.net.module.util.NetworkStackConstants;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -181,9 +182,9 @@ public final class RouteInfo implements Parcelable {
        if (destination == null) {
            if (gateway != null) {
                if (gateway instanceof Inet4Address) {
                    destination = new IpPrefix(Inet4Address.ANY, 0);
                    destination = new IpPrefix(NetworkStackConstants.IPV4_ADDR_ANY, 0);
                } else {
                    destination = new IpPrefix(Inet6Address.ANY, 0);
                    destination = new IpPrefix(NetworkStackConstants.IPV6_ADDR_ANY, 0);
                }
            } else {
                // no destination, no gateway. invalid.
@@ -196,9 +197,9 @@ public final class RouteInfo implements Parcelable {
        // ConnectivityService) to stop doing things like r.getGateway().equals(), ... .
        if (gateway == null) {
            if (destination.getAddress() instanceof Inet4Address) {
                gateway = Inet4Address.ANY;
                gateway = NetworkStackConstants.IPV4_ADDR_ANY;
            } else {
                gateway = Inet6Address.ANY;
                gateway = NetworkStackConstants.IPV6_ADDR_ANY;
            }
        }
        mHasGateway = (!gateway.isAnyLocalAddress());