am 50f86448: am 59a9884b: Merge "Do not change NetworkInfo.DetailedState." into jb-mr2-dev
* commit '50f864480d6e9cf9e4d83b4533e3764753b4d408': Do not change NetworkInfo.DetailedState.
This commit is contained in:
commit
2a6edf506b
1 changed files with 33 additions and 17 deletions
|
|
@ -83,13 +83,7 @@ public class NetworkInfo implements Parcelable {
|
|||
/** Link has poor connectivity. */
|
||||
VERIFYING_POOR_LINK,
|
||||
/** Checking if network is a captive portal */
|
||||
CAPTIVE_PORTAL_CHECK,
|
||||
/**
|
||||
* Network is connected to provisioning network
|
||||
* TODO: Probably not needed when we add TYPE_PROVISIONING_NETWORK
|
||||
* @hide
|
||||
*/
|
||||
CONNECTED_TO_PROVISIONING_NETWORK
|
||||
CAPTIVE_PORTAL_CHECK
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -114,7 +108,6 @@ public class NetworkInfo implements Parcelable {
|
|||
stateMap.put(DetailedState.DISCONNECTED, State.DISCONNECTED);
|
||||
stateMap.put(DetailedState.FAILED, State.DISCONNECTED);
|
||||
stateMap.put(DetailedState.BLOCKED, State.DISCONNECTED);
|
||||
stateMap.put(DetailedState.CONNECTED_TO_PROVISIONING_NETWORK, State.CONNECTED);
|
||||
}
|
||||
|
||||
private int mNetworkType;
|
||||
|
|
@ -127,6 +120,8 @@ public class NetworkInfo implements Parcelable {
|
|||
private String mExtraInfo;
|
||||
private boolean mIsFailover;
|
||||
private boolean mIsRoaming;
|
||||
private boolean mIsConnectedToProvisioningNetwork;
|
||||
|
||||
/**
|
||||
* Indicates whether network connectivity is possible:
|
||||
*/
|
||||
|
|
@ -155,6 +150,7 @@ public class NetworkInfo implements Parcelable {
|
|||
mState = State.UNKNOWN;
|
||||
mIsAvailable = false; // until we're told otherwise, assume unavailable
|
||||
mIsRoaming = false;
|
||||
mIsConnectedToProvisioningNetwork = false;
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
|
|
@ -171,6 +167,7 @@ public class NetworkInfo implements Parcelable {
|
|||
mIsFailover = source.mIsFailover;
|
||||
mIsRoaming = source.mIsRoaming;
|
||||
mIsAvailable = source.mIsAvailable;
|
||||
mIsConnectedToProvisioningNetwork = source.mIsConnectedToProvisioningNetwork;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -329,6 +326,22 @@ public class NetworkInfo implements Parcelable {
|
|||
}
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@VisibleForTesting
|
||||
public boolean isConnectedToProvisioningNetwork() {
|
||||
synchronized (this) {
|
||||
return mIsConnectedToProvisioningNetwork;
|
||||
}
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@VisibleForTesting
|
||||
public void setIsConnectedToProvisioningNetwork(boolean val) {
|
||||
synchronized (this) {
|
||||
mIsConnectedToProvisioningNetwork = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports the current coarse-grained state of the network.
|
||||
* @return the coarse-grained state
|
||||
|
|
@ -412,7 +425,9 @@ public class NetworkInfo implements Parcelable {
|
|||
append(", extra: ").append(mExtraInfo == null ? "(none)" : mExtraInfo).
|
||||
append(", roaming: ").append(mIsRoaming).
|
||||
append(", failover: ").append(mIsFailover).
|
||||
append(", isAvailable: ").append(mIsAvailable);
|
||||
append(", isAvailable: ").append(mIsAvailable).
|
||||
append(", isConnectedToProvisioningNetwork: ").
|
||||
append(mIsConnectedToProvisioningNetwork);
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -440,6 +455,7 @@ public class NetworkInfo implements Parcelable {
|
|||
dest.writeInt(mIsFailover ? 1 : 0);
|
||||
dest.writeInt(mIsAvailable ? 1 : 0);
|
||||
dest.writeInt(mIsRoaming ? 1 : 0);
|
||||
dest.writeInt(mIsConnectedToProvisioningNetwork ? 1 : 0);
|
||||
dest.writeString(mReason);
|
||||
dest.writeString(mExtraInfo);
|
||||
}
|
||||
|
|
@ -462,6 +478,7 @@ public class NetworkInfo implements Parcelable {
|
|||
netInfo.mIsFailover = in.readInt() != 0;
|
||||
netInfo.mIsAvailable = in.readInt() != 0;
|
||||
netInfo.mIsRoaming = in.readInt() != 0;
|
||||
netInfo.mIsConnectedToProvisioningNetwork = in.readInt() != 0;
|
||||
netInfo.mReason = in.readString();
|
||||
netInfo.mExtraInfo = in.readString();
|
||||
return netInfo;
|
||||
|
|
|
|||
Loading…
Reference in a new issue