Merge "Fix a bug where the legacy extra info is reset on connect." am: 7e2d55206e
Change-Id: Ia0a2afe359cac6adfd33d2f839eddb8bd14b5f43
This commit is contained in:
@@ -624,7 +624,9 @@ public abstract class NetworkAgent {
|
|||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"Legacy agents can't call markConnected.");
|
"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);
|
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,7 +640,9 @@ public abstract class NetworkAgent {
|
|||||||
if (mIsLegacy) {
|
if (mIsLegacy) {
|
||||||
throw new UnsupportedOperationException("Legacy agents can't call unregister.");
|
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);
|
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user