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

Commit 401bc816 authored by Peter Qiu's avatar Peter Qiu Committed by android-build-merger
Browse files

Merge changes from topic 'wrong_password' into oc-dr1-dev

am: 702d4d56

Change-Id: I827bed9cd0c57abb33c91af05a089f8f2f5d59fb
parents 36ddd7d0 702d4d56
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -703,6 +703,9 @@ public class AccessPoint implements Comparable<AccessPoint> {
                case WifiConfiguration.NetworkSelectionStatus.DISABLED_AUTHENTICATION_FAILURE:
                    summary.append(mContext.getString(R.string.wifi_disabled_password_failure));
                    break;
                case WifiConfiguration.NetworkSelectionStatus.DISABLED_BY_WRONG_PASSWORD:
                    summary.append(mContext.getString(R.string.wifi_check_password_try_again));
                    break;
                case WifiConfiguration.NetworkSelectionStatus.DISABLED_DHCP_FAILURE:
                case WifiConfiguration.NetworkSelectionStatus.DISABLED_DNS_FAILURE:
                    summary.append(mContext.getString(R.string.wifi_disabled_network_failure));
+13 −0
Original line number Diff line number Diff line
@@ -417,6 +417,19 @@ public class AccessPointTest {
        assertThat(ap.getSummary()).isEqualTo(expectedString);
    }

    @Test
    public void testSummaryString_showsWrongPasswordLabel() {
        WifiConfiguration configuration = createWifiConfiguration();
        configuration.getNetworkSelectionStatus().setNetworkSelectionStatus(
                WifiConfiguration.NetworkSelectionStatus.NETWORK_SELECTION_PERMANENTLY_DISABLED);
        configuration.getNetworkSelectionStatus().setNetworkSelectionDisableReason(
                WifiConfiguration.NetworkSelectionStatus.DISABLED_BY_WRONG_PASSWORD);
        AccessPoint ap = new AccessPoint(mContext, configuration);

        assertThat(ap.getSummary()).isEqualTo(mContext.getString(
                R.string.wifi_check_password_try_again));
    }

    private ScoredNetwork buildScoredNetworkWithMockBadgeCurve() {
        Bundle attr1 = new Bundle();
        attr1.putParcelable(ScoredNetwork.ATTRIBUTES_KEY_BADGING_CURVE, mockBadgeCurve);
+7 −2
Original line number Diff line number Diff line
@@ -890,10 +890,14 @@ public class WifiConfiguration implements Parcelable {
         * This network is disabled due to user switching
         */
        public static final int DISABLED_DUE_TO_USER_SWITCH = 11;
        /**
         * This network is disabled due to wrong password
         */
        public static final int DISABLED_BY_WRONG_PASSWORD = 12;
        /**
         * This Maximum disable reason value
         */
        public static final int NETWORK_SELECTION_DISABLED_MAX = 12;
        public static final int NETWORK_SELECTION_DISABLED_MAX = 13;

        /**
         * Quality network selection disable reason String (for debug purpose)
@@ -910,7 +914,8 @@ public class WifiConfiguration implements Parcelable {
                "NETWORK_SELECTION_DISABLED_AUTHENTICATION_NO_CREDENTIALS",
                "NETWORK_SELECTION_DISABLED_NO_INTERNET",
                "NETWORK_SELECTION_DISABLED_BY_WIFI_MANAGER",
                "NETWORK_SELECTION_DISABLED_BY_USER_SWITCH"
                "NETWORK_SELECTION_DISABLED_BY_USER_SWITCH",
                "NETWORK_SELECTION_DISABLED_BY_WRONG_PASSWORD"
        };

        /**