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

Commit 5c5b36f1 authored by Chiachang Wang's avatar Chiachang Wang Committed by Automerger Merge Worker
Browse files

Merge "Replace Proxy hidden constants and methods usages" am: e3be1ecb

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iba522bcd7591747f012918dc87f05f7aab1c2a1b
parents d25b9c12 e3be1ecb
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.Proxy;
import android.net.ProxyInfo;
import android.os.Bundle;
import android.text.Selection;
@@ -186,18 +185,18 @@ public class ProxySelector extends InstrumentedFragment implements DialogCreatab
     * @return 0 on success, string resource ID on failure
     */
    public static int validate(String hostname, String port, String exclList) {
        switch (Proxy.validate(hostname, port, exclList)) {
            case Proxy.PROXY_VALID:
        switch (ProxyUtils.validate(hostname, port, exclList)) {
            case ProxyUtils.PROXY_VALID:
                return 0;
            case Proxy.PROXY_HOSTNAME_EMPTY:
            case ProxyUtils.PROXY_HOSTNAME_EMPTY:
                return R.string.proxy_error_empty_host_set_port;
            case Proxy.PROXY_HOSTNAME_INVALID:
            case ProxyUtils.PROXY_HOSTNAME_INVALID:
                return R.string.proxy_error_invalid_host;
            case Proxy.PROXY_PORT_EMPTY:
            case ProxyUtils.PROXY_PORT_EMPTY:
                return R.string.proxy_error_empty_port;
            case Proxy.PROXY_PORT_INVALID:
            case ProxyUtils.PROXY_PORT_INVALID:
                return R.string.proxy_error_invalid_port;
            case Proxy.PROXY_EXCLLIST_INVALID:
            case ProxyUtils.PROXY_EXCLLIST_INVALID:
                return R.string.proxy_error_invalid_exclusion_list;
            default:
                // should neven happen
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static com.android.internal.net.VpnProfile.isLegacyType;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.net.Proxy;
import android.net.ProxyInfo;
import android.os.Bundle;
import android.os.SystemProperties;
@@ -41,6 +40,7 @@ import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;

import com.android.internal.net.VpnProfile;
import com.android.net.module.util.ProxyUtils;
import com.android.settings.R;

import java.net.InetAddress;
@@ -637,7 +637,7 @@ class ConfigDialog extends AlertDialog implements TextWatcher,

        final String host = mProxyHost.getText().toString().trim();
        final String port = mProxyPort.getText().toString().trim();
        return Proxy.validate(host, port, "") == Proxy.PROXY_VALID;
        return ProxyUtils.validate(host, port, "") == ProxyUtils.PROXY_VALID;
    }

}