Ignore link properties updates when nothing actually changed.
Change-Id: Ia3c0a652cb3b67707a5c5a0bb40f991ef1e6f777
This commit is contained in:
@@ -43,6 +43,7 @@ import com.android.server.net.NetlinkTracker;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
@@ -284,6 +285,12 @@ public class IpManager extends StateMachine {
|
||||
return delta;
|
||||
}
|
||||
|
||||
private boolean linkPropertiesUnchanged(LinkProperties newLp) {
|
||||
synchronized (mLock) {
|
||||
return Objects.equals(newLp, mLinkProperties);
|
||||
}
|
||||
}
|
||||
|
||||
private LinkProperties assembleLinkProperties() {
|
||||
// [1] Create a new LinkProperties object to populate.
|
||||
LinkProperties newLp = new LinkProperties();
|
||||
@@ -489,6 +496,9 @@ public class IpManager extends StateMachine {
|
||||
|
||||
case EVENT_NETLINK_LINKPROPERTIES_CHANGED: {
|
||||
final LinkProperties newLp = assembleLinkProperties();
|
||||
if (linkPropertiesUnchanged(newLp)) {
|
||||
break;
|
||||
}
|
||||
final ProvisioningChange delta = setLinkProperties(newLp);
|
||||
|
||||
// NOTE: The only receiver of these callbacks currently
|
||||
|
||||
Reference in New Issue
Block a user