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

Commit 163d8ea6 authored by markchien's avatar markchien Committed by Mark Chien
Browse files

DO NOT MERGE fix some linkproperties configs missing

In handleUpdateLinkProperties(), it will always assign newLp
to nai first. Then, the copied newLp would add some configurations
ex: private dns/clatd. This updated newLp wouldn't be assigned back to
nai when linkproperties is not changed.

Bug: 113637648
Test: - build, flash, booted
      - atest FrameworksNetTests
      - run CtsNetTestCases

Change-Id: I9e25e46718e076d4afa784ee5e1d3abbe0f11911
parent 63519217
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4731,11 +4731,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
        } else {
            updateProxy(newLp, oldLp, networkAgent);
        }
        // TODO - move this check to cover the whole function
        if (!Objects.equals(newLp, oldLp)) {

        synchronized (networkAgent) {
            networkAgent.linkProperties = newLp;
        }
        // TODO - move this check to cover the whole function
        if (!Objects.equals(newLp, oldLp)) {
            notifyIfacesChangedForNetworkStats();
            notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_IP_CHANGED);
        }
+8 −0
Original line number Diff line number Diff line
@@ -4024,6 +4024,14 @@ public class ConnectivityServiceTest {
        cellNetworkCallback.assertNoCallback();
        assertTrue(((LinkProperties)cbi.arg).isPrivateDnsActive());
        assertEquals("strict.example.com", ((LinkProperties)cbi.arg).getPrivateDnsServerName());

        // Send the same LinkProperties and expect getting the same result including private dns.
        // b/118518971
        LinkProperties oldLp = (LinkProperties) cbi.arg;
        mCellNetworkAgent.sendLinkProperties(cellLp);
        waitForIdle();
        LinkProperties newLp = mCm.getLinkProperties(cbi.network);
        assertEquals(oldLp, newLp);
    }

    @Test