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

Commit 4399bad6 authored by Chalard Jean's avatar Chalard Jean Committed by Automerger Merge Worker
Browse files

Merge "Fix a bug where the legacy extra info is reset on connect." am:...

Merge "Fix a bug where the legacy extra info is reset on connect." am: 67370a01 am: a5f7fcac am: a072ef0c

Change-Id: I0406172efbdbbffe5db66efc3b94844bf14d6f04
parents 16a0d90e a072ef0c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -624,7 +624,9 @@ public abstract class NetworkAgent {
            throw new UnsupportedOperationException(
                    "Legacy agents can't call markConnected.");
        }
        mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, null, null);
        // |reason| cannot be used by the non-legacy agents
        mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, null /* reason */,
                mNetworkInfo.getExtraInfo());
        queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
    }

@@ -638,7 +640,9 @@ public abstract class NetworkAgent {
        if (mIsLegacy) {
            throw new UnsupportedOperationException("Legacy agents can't call unregister.");
        }
        mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null, null);
        // When unregistering an agent nobody should use the extrainfo (or reason) any more.
        mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null /* reason */,
                null /* extraInfo */);
        queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
    }