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

Commit bb3fc0b5 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Tethering: Fix hidden API selectBestRoute" am: 385c17e1 am: 4bd5b588

Change-Id: I7663dcc98fd600f08e079d716679a532e78b915a
parents b2c73ad0 4bd5b588
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ java_defaults {
        "netlink-client",
        "networkstack-aidl-interfaces-unstable-java",
        "android.hardware.tetheroffload.control-V1.0-java",
        "net-utils-framework-common",
    ],
    libs: [
        "framework-tethering",
+3 −1
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ import android.net.NetworkCapabilities;
import android.net.RouteInfo;
import android.net.util.InterfaceSet;

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

import java.net.InetAddress;
import java.net.UnknownHostException;

@@ -85,7 +87,7 @@ public final class TetheringInterfaceUtils {

    private static String getInterfaceForDestination(LinkProperties lp, InetAddress dst) {
        final RouteInfo ri = (lp != null)
                ? RouteInfo.selectBestRoute(lp.getAllRoutes(), dst)
                ? NetUtils.selectBestRoute(lp.getAllRoutes(), dst)
                : null;
        return (ri != null) ? ri.getInterface() : null;
    }