Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18aa304f authored by Shirish Kalele's avatar Shirish Kalele Committed by Android Git Automerger
Browse files

am 869c230c: Merge "Mark a connection as a Wifi Assistant connection based on...

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 '869c230c':
  Mark a connection as a Wifi Assistant connection based on the ephemeral flag in WifiInfo. Add this private field to WifiInfo.
parents b6ab0ca3 869c230c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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. */
+16 −0
Original line number Diff line number Diff line
@@ -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();