diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/net/NetworkAgent.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/net/NetworkAgent.java b/core/java/android/net/NetworkAgent.java index fe90a8457949..c42dacc187a9 100644 --- a/core/java/android/net/NetworkAgent.java +++ b/core/java/android/net/NetworkAgent.java @@ -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); } |
