Merge "Add hasEverConnected to NetworkStatus object" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
174b140dfe
@@ -937,6 +937,15 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
private boolean mSeenInLastQualifiedNetworkSelection;
|
private boolean mSeenInLastQualifiedNetworkSelection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boolean indicating if we have ever successfully connected to this network.
|
||||||
|
*
|
||||||
|
* This value will be set to true upon a successful connection.
|
||||||
|
* This value will be set to false if a previous value was not stored in the config or if
|
||||||
|
* the credentials are updated (ex. a password change).
|
||||||
|
*/
|
||||||
|
private boolean mHasEverConnected;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set whether this network is visible in latest Qualified Network Selection
|
* set whether this network is visible in latest Qualified Network Selection
|
||||||
* @param seen value set to candidate
|
* @param seen value set to candidate
|
||||||
@@ -1027,7 +1036,18 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
return QUALITY_NETWORK_SELECTION_STATUS[mStatus];
|
return QUALITY_NETWORK_SELECTION_STATUS[mStatus];
|
||||||
}
|
}
|
||||||
|
|
||||||
private NetworkSelectionStatus() {};
|
public void setHasEverConnected(boolean value) {
|
||||||
|
mHasEverConnected = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getHasEverConnected() {
|
||||||
|
return mHasEverConnected;
|
||||||
|
}
|
||||||
|
|
||||||
|
private NetworkSelectionStatus() {
|
||||||
|
// previously stored configs will not have this parameter, so we default to false.
|
||||||
|
mHasEverConnected = false;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param reason specific error reason
|
* @param reason specific error reason
|
||||||
@@ -1226,6 +1246,7 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
mNetworkSelectionBSSID = source.mNetworkSelectionBSSID;
|
mNetworkSelectionBSSID = source.mNetworkSelectionBSSID;
|
||||||
setConnectChoice(source.getConnectChoice());
|
setConnectChoice(source.getConnectChoice());
|
||||||
setConnectChoiceTimestamp(source.getConnectChoiceTimestamp());
|
setConnectChoiceTimestamp(source.getConnectChoiceTimestamp());
|
||||||
|
setHasEverConnected(source.getHasEverConnected());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeToParcel(Parcel dest) {
|
public void writeToParcel(Parcel dest) {
|
||||||
@@ -1244,6 +1265,7 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
} else {
|
} else {
|
||||||
dest.writeInt(CONNECT_CHOICE_NOT_EXISTS);
|
dest.writeInt(CONNECT_CHOICE_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
dest.writeInt(getHasEverConnected() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFromParcel(Parcel in) {
|
public void readFromParcel(Parcel in) {
|
||||||
@@ -1262,6 +1284,7 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
setConnectChoice(null);
|
setConnectChoice(null);
|
||||||
setConnectChoiceTimestamp(INVALID_NETWORK_SELECTION_DISABLE_TIMESTAMP);
|
setConnectChoiceTimestamp(INVALID_NETWORK_SELECTION_DISABLE_TIMESTAMP);
|
||||||
}
|
}
|
||||||
|
setHasEverConnected(in.readInt() != 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1389,6 +1412,8 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
sbuf.append(" connect choice set time: ").append(mNetworkSelectionStatus
|
sbuf.append(" connect choice set time: ").append(mNetworkSelectionStatus
|
||||||
.getConnectChoiceTimestamp());
|
.getConnectChoiceTimestamp());
|
||||||
}
|
}
|
||||||
|
sbuf.append(" hasEverConnected: ")
|
||||||
|
.append(mNetworkSelectionStatus.getHasEverConnected()).append("\n");
|
||||||
|
|
||||||
if (this.numAssociation > 0) {
|
if (this.numAssociation > 0) {
|
||||||
sbuf.append(" numAssociation ").append(this.numAssociation).append("\n");
|
sbuf.append(" numAssociation ").append(this.numAssociation).append("\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user