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

Commit f7e6637f authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge fc897ddb on remote branch

Change-Id: I88e21c2f85991e022eee6ec18ca4b916514e4847
parents 1b343751 fc897ddb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -966,6 +966,7 @@ public final class WifiService extends IWifiManager.Stub {
     * @deprecated
     */
    public DhcpInfo getDhcpInfo() {
        int prefixLength = -1;
        enforceAccessPermission();
        DhcpResults dhcpResults = mWifiStateMachine.syncGetDhcpResults();
        if (dhcpResults.linkProperties == null) return null;
@@ -975,6 +976,7 @@ public final class WifiService extends IWifiManager.Stub {
            InetAddress addr = la.getAddress();
            if (addr instanceof Inet4Address) {
                info.ipAddress = NetworkUtils.inetAddressToInt((Inet4Address)addr);
                prefixLength = la.getNetworkPrefixLength();
                break;
            }
        }
@@ -983,6 +985,10 @@ public final class WifiService extends IWifiManager.Stub {
                InetAddress gateway = r.getGateway();
                if (gateway instanceof Inet4Address) {
                    info.gateway = NetworkUtils.inetAddressToInt((Inet4Address)gateway);
                    // in case of using the static IP,
                    // let's get the prefix length to generate the netmask
                    if(info.netmask == 0 && prefixLength != -1)
                        info.netmask = NetworkUtils.prefixLengthToNetmaskInt(prefixLength);
                }
            } else if (r.hasGateway() == false) {
                LinkAddress dest = r.getDestination();