Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d51d8ba authored by Erik Kline's avatar Erik Kline Committed by android-build-merger
Browse files

Ignore link properties updates when nothing actually changed.

am: 6076cb0b

* commit '6076cb0b':
  Ignore link properties updates when nothing actually changed.
parents e5345d86 6076cb0b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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