am 869c230c: Merge "Mark a connection as a Wifi Assistant connection based on the ephemeral flag in WifiInfo. Add this private field to WifiInfo." into mnc-dev
* commit '869c230c1466e517289d692dce85acf0c30296c4': Mark a connection as a Wifi Assistant connection based on the ephemeral flag in WifiInfo. Add this private field to WifiInfo.
This commit is contained in:
@@ -387,7 +387,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
|
||||
} else if (isActive()) {
|
||||
// This is the active connection on non-passpoint network
|
||||
summary.append(getSummary(mContext, getDetailedState(),
|
||||
networkId == WifiConfiguration.INVALID_NETWORK_ID));
|
||||
mInfo != null && mInfo.isEphemeral()));
|
||||
} else if (mConfig != null && mConfig.isPasspoint()) {
|
||||
String format = mContext.getString(R.string.available_via_passpoint);
|
||||
summary.append(String.format(format, mConfig.providerFriendlyName));
|
||||
@@ -620,7 +620,8 @@ public class AccessPoint implements Comparable<AccessPoint> {
|
||||
}
|
||||
|
||||
public boolean isEphemeral() {
|
||||
return !isSaved() && mNetworkInfo != null && mNetworkInfo.getState() != State.DISCONNECTED;
|
||||
return mInfo != null && mInfo.isEphemeral() &&
|
||||
mNetworkInfo != null && mNetworkInfo.getState() != State.DISCONNECTED;
|
||||
}
|
||||
|
||||
/** Return whether the given {@link WifiInfo} is for this access point. */
|
||||
@@ -757,7 +758,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
|
||||
mAccessPointListener.onAccessPointChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String getSummary(Context context, String ssid, DetailedState state,
|
||||
boolean isEphemeral, String passpointProvider) {
|
||||
if (state == DetailedState.CONNECTED && ssid == null) {
|
||||
|
||||
@@ -101,6 +101,8 @@ public class WifiInfo implements Parcelable {
|
||||
private InetAddress mIpAddress;
|
||||
private String mMacAddress = DEFAULT_MAC_ADDRESS;
|
||||
|
||||
private boolean mEphemeral;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@@ -253,6 +255,7 @@ public class WifiInfo implements Parcelable {
|
||||
setLinkSpeed(-1);
|
||||
setFrequency(-1);
|
||||
setMeteredHint(false);
|
||||
setEphemeral(false);
|
||||
txBad = 0;
|
||||
txSuccess = 0;
|
||||
rxSuccess = 0;
|
||||
@@ -283,6 +286,7 @@ public class WifiInfo implements Parcelable {
|
||||
mIpAddress = source.mIpAddress;
|
||||
mMacAddress = source.mMacAddress;
|
||||
mMeteredHint = source.mMeteredHint;
|
||||
mEphemeral = source.mEphemeral;
|
||||
txBad = source.txBad;
|
||||
txRetries = source.txRetries;
|
||||
txSuccess = source.txSuccess;
|
||||
@@ -430,6 +434,16 @@ public class WifiInfo implements Parcelable {
|
||||
return mMeteredHint;
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
public void setEphemeral(boolean ephemeral) {
|
||||
mEphemeral = ephemeral;
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
public boolean isEphemeral() {
|
||||
return mEphemeral;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void setNetworkId(int id) {
|
||||
mNetworkId = id;
|
||||
@@ -567,6 +581,7 @@ public class WifiInfo implements Parcelable {
|
||||
dest.writeString(mBSSID);
|
||||
dest.writeString(mMacAddress);
|
||||
dest.writeInt(mMeteredHint ? 1 : 0);
|
||||
dest.writeInt(mEphemeral ? 1 : 0);
|
||||
dest.writeInt(score);
|
||||
dest.writeDouble(txSuccessRate);
|
||||
dest.writeDouble(txRetriesRate);
|
||||
@@ -597,6 +612,7 @@ public class WifiInfo implements Parcelable {
|
||||
info.mBSSID = in.readString();
|
||||
info.mMacAddress = in.readString();
|
||||
info.mMeteredHint = in.readInt() != 0;
|
||||
info.mEphemeral = in.readInt() != 0;
|
||||
info.score = in.readInt();
|
||||
info.txSuccessRate = in.readDouble();
|
||||
info.txRetriesRate = in.readDouble();
|
||||
|
||||
Reference in New Issue
Block a user