Fix minor thread corectness issue in NetworkInfo
Hold the right lock while copying info from another NetworkInfo object to prevent changes being made to it while the copy is in progress. Change-Id: I1aa2c29e81e045b0359f957352c438e79e692823
This commit is contained in:
@@ -156,6 +156,7 @@ public class NetworkInfo implements Parcelable {
|
||||
/** {@hide} */
|
||||
public NetworkInfo(NetworkInfo source) {
|
||||
if (source != null) {
|
||||
synchronized (source) {
|
||||
mNetworkType = source.mNetworkType;
|
||||
mSubtype = source.mSubtype;
|
||||
mTypeName = source.mTypeName;
|
||||
@@ -170,6 +171,7 @@ public class NetworkInfo implements Parcelable {
|
||||
mIsConnectedToProvisioningNetwork = source.mIsConnectedToProvisioningNetwork;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports the type of network to which the
|
||||
|
||||
Reference in New Issue
Block a user