summaryrefslogtreecommitdiffstats
path: root/core/java/android/net
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2011-09-09 15:52:42 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-09-09 15:52:42 -0700
commit61db35da2b4501dde5646f86f21cf5054c41ea26 (patch)
tree90a5dc096c1b5e984939d4d5856b1f8cf30e7316 /core/java/android/net
parent30928eb60395ac7c02ac45fd00a0d781ce364856 (diff)
parent2f835a6193c14e27cf761d85ac3ea4c9bd9296f8 (diff)
downloadframeworks_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.java2
-rw-r--r--core/java/android/net/NetworkInfo.java17
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.