Merge "Replace NetworkUtils methods" am: 3dd1c29aee

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1571848

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4419b7cc320726dbac4c324f6ce5c42434322fc7
This commit is contained in:
Chiachang Wang
2021-02-24 00:16:42 +00:00
committed by Automerger Merge Worker
4 changed files with 12 additions and 10 deletions

View File

@@ -18,11 +18,11 @@ package com.android.settings.wifi;
import android.content.Context;
import android.content.res.Resources;
import android.net.InetAddresses;
import android.net.IpConfiguration;
import android.net.IpConfiguration.IpAssignment;
import android.net.IpConfiguration.ProxySettings;
import android.net.LinkAddress;
import android.net.NetworkUtils;
import android.net.ProxyInfo;
import android.net.StaticIpConfiguration;
import android.net.Uri;
@@ -67,6 +67,7 @@ import android.widget.TextView;
import androidx.annotation.VisibleForTesting;
import com.android.net.module.util.NetUtils;
import com.android.net.module.util.ProxyUtils;
import com.android.settings.ProxySelector;
import com.android.settings.R;
@@ -880,7 +881,7 @@ public class WifiConfigController2 implements TextWatcher,
private Inet4Address getIPv4Address(String text) {
try {
return (Inet4Address) NetworkUtils.numericToInetAddress(text);
return (Inet4Address) InetAddresses.parseNumericAddress(text);
} catch (IllegalArgumentException | ClassCastException e) {
return null;
}
@@ -916,7 +917,7 @@ public class WifiConfigController2 implements TextWatcher,
if (TextUtils.isEmpty(gateway)) {
try {
//Extract a default gateway from IP address
InetAddress netPart = NetworkUtils.getNetworkPart(inetAddr, networkPrefixLength);
InetAddress netPart = NetUtils.getNetworkPart(inetAddr, networkPrefixLength);
byte[] addr = netPart.getAddress();
addr[addr.length - 1] = 1;
mGatewayView.setText(InetAddress.getByAddress(addr).getHostAddress());