am 6b57033b: am 8b81a638: Merge "getProxy in ConnectivityService returns port w/PAC" into klp-dev
* commit '6b57033b022890242d6833b494040c360af691d0': getProxy in ConnectivityService returns port w/PAC
This commit is contained in:
@@ -178,7 +178,7 @@ public class ProxyProperties implements Parcelable {
|
||||
// If PAC URL is present in either then they must be equal.
|
||||
// Other parameters will only be for fall back.
|
||||
if (!TextUtils.isEmpty(mPacFileUrl)) {
|
||||
return mPacFileUrl.equals(p.getPacFileUrl());
|
||||
return mPacFileUrl.equals(p.getPacFileUrl()) && mPort == p.mPort;
|
||||
}
|
||||
if (!TextUtils.isEmpty(p.getPacFileUrl())) {
|
||||
return false;
|
||||
@@ -219,6 +219,7 @@ public class ProxyProperties implements Parcelable {
|
||||
if (mPacFileUrl != null) {
|
||||
dest.writeByte((byte)1);
|
||||
dest.writeString(mPacFileUrl);
|
||||
dest.writeInt(mPort);
|
||||
return;
|
||||
} else {
|
||||
dest.writeByte((byte)0);
|
||||
@@ -244,7 +245,9 @@ public class ProxyProperties implements Parcelable {
|
||||
String host = null;
|
||||
int port = 0;
|
||||
if (in.readByte() != 0) {
|
||||
return new ProxyProperties(in.readString());
|
||||
String url = in.readString();
|
||||
int localPort = in.readInt();
|
||||
return new ProxyProperties(url, localPort);
|
||||
}
|
||||
if (in.readByte() != 0) {
|
||||
host = in.readString();
|
||||
|
||||
@@ -353,6 +353,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
*/
|
||||
private static final int EVENT_SAMPLE_INTERVAL_ELAPSED = 15;
|
||||
|
||||
/**
|
||||
* PAC manager has received new port.
|
||||
*/
|
||||
private static final int EVENT_PROXY_HAS_CHANGED = 16;
|
||||
|
||||
/** Handler used for internal events. */
|
||||
private InternalHandler mHandler;
|
||||
/** Handler used for incoming {@link NetworkStateTracker} events. */
|
||||
@@ -679,7 +684,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
},
|
||||
new IntentFilter(filter));
|
||||
|
||||
mPacManager = new PacManager(mContext);
|
||||
mPacManager = new PacManager(mContext, mHandler, EVENT_PROXY_HAS_CHANGED);
|
||||
|
||||
filter = new IntentFilter();
|
||||
filter.addAction(CONNECTED_TO_PROVISIONING_NETWORK_ACTION);
|
||||
@@ -3124,6 +3129,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
handleNetworkSamplingTimeout();
|
||||
break;
|
||||
}
|
||||
case EVENT_PROXY_HAS_CHANGED: {
|
||||
handleApplyDefaultProxy((ProxyProperties)msg.obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user