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

Commit 38d3b2c9 authored by markchien's avatar markchien Committed by Mark Chien
Browse files

Tethering: Fix hidden API selectBestRoute

Bug: 143925787
Test: -build, flash, boot
      -ON/OFF hotspot
      -atest TetheringTests

Change-Id: I824a05fac8b606123667d20ab9b1f7de905e4088
parent f7f94e34
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;
    }