Example usage for android.net ProxyInfo getHost

List of usage examples for android.net ProxyInfo getHost

Introduction

In this page you can find the example usage for android.net ProxyInfo getHost.

Prototype

public String getHost() 

Source Link

Document

When configured to use a Direct Proxy this returns the host of the proxy.

Usage

From source file:android.net.ProxyInfo.java

/**
 * @hide/* w w w .  ja va2 s  .co  m*/
 */
public ProxyInfo(ProxyInfo source) {
    if (source != null) {
        mHost = source.getHost();
        mPort = source.getPort();
        mPacFileUrl = source.mPacFileUrl;
        mExclusionList = source.getExclusionListAsString();
        mParsedExclusionList = source.mParsedExclusionList;
    } else {
        mPacFileUrl = Uri.EMPTY;
    }
}

From source file:android.net.ProxyInfo.java

@Override
public boolean equals(Object o) {
    if (!(o instanceof ProxyInfo))
        return false;
    ProxyInfo p = (ProxyInfo) o;
    // If PAC URL is present in either then they must be equal.
    // Other parameters will only be for fall back.
    if (!Uri.EMPTY.equals(mPacFileUrl)) {
        return mPacFileUrl.equals(p.getPacFileUrl()) && mPort == p.mPort;
    }/* www. j  a  v  a2 s . c om*/
    if (!Uri.EMPTY.equals(p.mPacFileUrl)) {
        return false;
    }
    if (mExclusionList != null && !mExclusionList.equals(p.getExclusionListAsString())) {
        return false;
    }
    if (mHost != null && p.getHost() != null && mHost.equals(p.getHost()) == false) {
        return false;
    }
    if (mHost != null && p.mHost == null)
        return false;
    if (mHost == null && p.mHost != null)
        return false;
    if (mPort != p.mPort)
        return false;
    return true;
}