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

Commit 919d4646 authored by Quang Luong's avatar Quang Luong
Browse files

Set connected OSU network to active AP at top of wifi picker

Clicking on an OSU network in the wifi picker should result in
the OSU network properly showing at the top as the connected
network instead of the underlying infrastructure AP.

Tracking bug for adding robolectric tests: b/122849296

Bug: 118705403
Test: manual, build and visual check
Change-Id: I05560b07acffb8aa85ac371d613088d5b7cd19f6
parent 550f7d4d
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -886,7 +886,17 @@ public class AccessPoint implements Comparable<AccessPoint> {
        // Update to new summary
        StringBuilder summary = new StringBuilder();

        if (isActive()) {
        if (isOsuProvider()) {
            if (mOsuProvisioningComplete) {
                summary.append(mContext.getString(R.string.osu_provisioning_complete));
            } else if (mOsuFailure != null) {
                summary.append(mOsuFailure);
            } else if (mOsuStatus != null) {
                summary.append(mOsuStatus);
            } else {
                summary.append(mContext.getString(R.string.tap_to_set_up));
            }
        } else if (isActive()) {
            if (isPasspoint()) {
                // This is the active connection on passpoint
                summary.append(getSummary(mContext, ssid, getDetailedState(),
@@ -931,16 +941,6 @@ public class AccessPoint implements Comparable<AccessPoint> {
            } else if (mIsCarrierAp) {
                summary.append(String.format(mContext.getString(
                        R.string.available_via_carrier), mCarrierName));
            } else if (isOsuProvider()) {
                if (mOsuProvisioningComplete) {
                    summary.append(mContext.getString(R.string.osu_provisioning_complete));
                } else if (mOsuFailure != null) {
                    summary.append(mOsuFailure);
                } else if (mOsuStatus != null) {
                    summary.append(mOsuStatus);
                } else {
                    summary.append(mContext.getString(R.string.tap_to_set_up));
                }
            } else if (!isReachable()) { // Wifi out of range
                summary.append(mContext.getString(R.string.wifi_not_in_range));
            } else { // In range, not disabled.
@@ -1045,6 +1045,10 @@ public class AccessPoint implements Comparable<AccessPoint> {
     * match based on SSID and security.
     */
    private boolean isInfoForThisAccessPoint(WifiConfiguration config, WifiInfo info) {
        if (info.isOsuAp()) {
            return (mOsuStatus != null);
        }

        if (isPasspoint() == false && networkId != WifiConfiguration.INVALID_NETWORK_ID) {
            return networkId == info.getNetworkId();
        } else if (config != null) {