diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2011-09-09 15:52:42 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-09-09 15:52:42 -0700 |
commit | 61db35da2b4501dde5646f86f21cf5054c41ea26 (patch) | |
tree | 90a5dc096c1b5e984939d4d5856b1f8cf30e7316 /core/java/android/net | |
parent | 30928eb60395ac7c02ac45fd00a0d781ce364856 (diff) | |
parent | 2f835a6193c14e27cf761d85ac3ea4c9bd9296f8 (diff) | |
download | frameworks_base-61db35da2b4501dde5646f86f21cf5054c41ea26.zip frameworks_base-61db35da2b4501dde5646f86f21cf5054c41ea26.tar.gz frameworks_base-61db35da2b4501dde5646f86f21cf5054c41ea26.tar.bz2 |
am 2f835a61: Merge "Make copies of NetworkInfo to give out." into honeycomb-LTE
* commit '2f835a6193c14e27cf761d85ac3ea4c9bd9296f8':
Make copies of NetworkInfo to give out.
Diffstat (limited to 'core/java/android/net')
-rw-r--r-- | core/java/android/net/MobileDataStateTracker.java | 2 | ||||
-rw-r--r-- | core/java/android/net/NetworkInfo.java | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java index f3c863f..76c97d7 100644 --- a/core/java/android/net/MobileDataStateTracker.java +++ b/core/java/android/net/MobileDataStateTracker.java @@ -386,7 +386,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { && lastReason != null) reason = lastReason; mNetworkInfo.setDetailedState(state, reason, extraInfo); - Message msg = mTarget.obtainMessage(EVENT_STATE_CHANGED, mNetworkInfo); + Message msg = mTarget.obtainMessage(EVENT_STATE_CHANGED, new NetworkInfo(mNetworkInfo)); msg.sendToTarget(); } } diff --git a/core/java/android/net/NetworkInfo.java b/core/java/android/net/NetworkInfo.java index 5f5e11c..65a11cc 100644 --- a/core/java/android/net/NetworkInfo.java +++ b/core/java/android/net/NetworkInfo.java @@ -138,6 +138,23 @@ public class NetworkInfo implements Parcelable { mIsRoaming = false; } + /** {@hide} */ + public NetworkInfo(NetworkInfo source) { + if (source != null) { + mNetworkType = source.mNetworkType; + mSubtype = source.mSubtype; + mTypeName = source.mTypeName; + mSubtypeName = source.mSubtypeName; + mState = source.mState; + mDetailedState = source.mDetailedState; + mReason = source.mReason; + mExtraInfo = source.mExtraInfo; + mIsFailover = source.mIsFailover; + mIsRoaming = source.mIsRoaming; + mIsAvailable = source.mIsAvailable; + } + } + /** * Reports the type of network (currently mobile or Wi-Fi) to which the * info in this object pertains. |