IpManager: delete dead getLinkProperties() code
Now that it's long since been unused also delete the locking that was
introduced to make it possible.
Bug: 17733693
Bug: 24837343
Change-Id: Iee817a7c2e1d1dc9c080d3124d5986232dcda00f
diff --git a/services/net/java/android/net/ip/IpManager.java b/services/net/java/android/net/ip/IpManager.java
index 2683673..e39f1bc 100644
--- a/services/net/java/android/net/ip/IpManager.java
+++ b/services/net/java/android/net/ip/IpManager.java
@@ -41,7 +41,6 @@
import android.util.Log;
import android.util.SparseArray;
-import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.State;
@@ -330,7 +329,6 @@
// TODO: Revert this hack once IpManager and Nat464Xlat work in concert.
private static final String CLAT_PREFIX = "v4-";
- private final Object mLock = new Object();
private final State mStoppedState = new StoppedState();
private final State mStoppingState = new StoppingState();
private final State mStartedState = new StartedState();
@@ -350,6 +348,7 @@
/**
* Non-final member variables accessed only from within our StateMachine.
*/
+ private LinkProperties mLinkProperties;
private ProvisioningConfiguration mConfiguration;
private IpReachabilityMonitor mIpReachabilityMonitor;
private DhcpClient mDhcpClient;
@@ -360,13 +359,6 @@
private boolean mMulticastFiltering;
private long mStartTimeMillis;
- /**
- * Member variables accessed both from within the StateMachine thread
- * and via accessors from other threads.
- */
- @GuardedBy("mLock")
- private LinkProperties mLinkProperties;
-
public IpManager(Context context, String ifName, Callback callback)
throws IllegalArgumentException {
this(context, ifName, callback, INetworkManagementService.Stub.asInterface(
@@ -506,12 +498,6 @@
sendMessage(CMD_SET_MULTICAST_FILTER, enabled);
}
- public LinkProperties getLinkProperties() {
- synchronized (mLock) {
- return new LinkProperties(mLinkProperties);
- }
- }
-
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
pw.println("APF dump:");
@@ -586,10 +572,8 @@
mTcpBufferSizes = "";
mHttpProxy = null;
- synchronized (mLock) {
- mLinkProperties = new LinkProperties();
- mLinkProperties.setInterfaceName(mInterfaceName);
- }
+ mLinkProperties = new LinkProperties();
+ mLinkProperties.setInterfaceName(mInterfaceName);
}
private void recordMetric(final int type) {
@@ -695,11 +679,8 @@
mIpReachabilityMonitor.updateLinkProperties(newLp);
}
- ProvisioningChange delta;
- synchronized (mLock) {
- delta = compareProvisioning(mLinkProperties, newLp);
- mLinkProperties = new LinkProperties(newLp);
- }
+ ProvisioningChange delta = compareProvisioning(mLinkProperties, newLp);
+ mLinkProperties = new LinkProperties(newLp);
if (DBG) {
switch (delta) {
@@ -714,9 +695,7 @@
}
private boolean linkPropertiesUnchanged(LinkProperties newLp) {
- synchronized (mLock) {
- return Objects.equals(newLp, mLinkProperties);
- }
+ return Objects.equals(newLp, mLinkProperties);
}
private LinkProperties assembleLinkProperties() {
@@ -970,7 +949,7 @@
} else {
if (VDBG) { Log.d(mTag, "onProvisioningFailure()"); }
recordMetric(IPCE_IPMGR_PROVISIONING_FAIL);
- mCallback.onProvisioningFailure(getLinkProperties());
+ mCallback.onProvisioningFailure(new LinkProperties(mLinkProperties));
transitionTo(mStoppingState);
}
} else {