From 37e65ebb7eb932e1a144b1cab262e11ca5fd109b Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Mon, 30 Aug 2010 10:56:47 -0700 Subject: Rename NetworkProperties to LinkProperties Also add copy constructors and use them when giving out data. Change-Id: Id320eb8fb91d0bd250305ce7bb4f628570215615 --- core/java/android/net/ProxyProperties.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'core/java/android/net/ProxyProperties.java') diff --git a/core/java/android/net/ProxyProperties.java b/core/java/android/net/ProxyProperties.java index 207fb51..24f6766 100644 --- a/core/java/android/net/ProxyProperties.java +++ b/core/java/android/net/ProxyProperties.java @@ -36,24 +36,31 @@ public class ProxyProperties implements Parcelable { public ProxyProperties() { } - public synchronized InetAddress getAddress() { + // copy constructor instead of clone + public ProxyProperties(ProxyProperties source) { + mProxy = source.getAddress(); + mPort = source.getPort(); + mExclusionList = new String(source.getExclusionList()); + } + + public InetAddress getAddress() { return mProxy; } - public synchronized void setAddress(InetAddress proxy) { + public void setAddress(InetAddress proxy) { mProxy = proxy; } - public synchronized int getPort() { + public int getPort() { return mPort; } - public synchronized void setPort(int port) { + public void setPort(int port) { mPort = port; } - public synchronized String getExclusionList() { + public String getExclusionList() { return mExclusionList; } - public synchronized void setExclusionList(String exclusionList) { + public void setExclusionList(String exclusionList) { mExclusionList = exclusionList; } @@ -77,7 +84,7 @@ public class ProxyProperties implements Parcelable { * Implement the Parcelable interface. * @hide */ - public synchronized void writeToParcel(Parcel dest, int flags) { + public void writeToParcel(Parcel dest, int flags) { if (mProxy != null) { dest.writeByte((byte)1); dest.writeString(mProxy.getHostName()); -- cgit v1.1