diff options
| -rw-r--r-- | packages/SettingsLib/res/values/strings.xml | 82 | ||||
| -rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java | 132 |
2 files changed, 30 insertions, 184 deletions
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml index c8f8d737fb0e..116fc8bf568a 100644 --- a/packages/SettingsLib/res/values/strings.xml +++ b/packages/SettingsLib/res/values/strings.xml @@ -104,7 +104,7 @@ <!-- Status message of Wi-Fi when network has matching passpoint credentials. [CHAR LIMIT=NONE] --> <string name="available_via_passpoint">Available via %1$s</string> <!-- Status message of OSU Provider network when not connected. [CHAR LIMIT=NONE] --> - <string name="tap_to_set_up">Tap to set up</string> + <string name="tap_to_sign_up">Tap to sign up</string> <!-- Package name for Settings app--> <string name="settings_package" translatable="false">com.android.settings</string> <!-- Package name for Certinstaller app--> @@ -127,78 +127,16 @@ <!-- Status message of Wi-Fi when an available network is a carrier network. [CHAR LIMIT=NONE] --> <string name="available_via_carrier">Available via %1$s</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_AP_CONNECTION. [CHAR LIMIT=NONE] --> - <string name="osu_failure_ap_connection">Connection failed</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_SERVER_URL_INVALID. [CHAR LIMIT=NONE] --> - <string name="osu_failure_server_url_invalid">Invalid OSU server URL</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_SERVER_CONNECTION. [CHAR LIMIT=NONE] --> - <string name="osu_failure_server_connection">OSU server connection failed</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_SERVER_VALIDATION. [CHAR LIMIT=NONE] --> - <string name="osu_failure_server_validation">OSU server validation failed</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION. [CHAR LIMIT=NONE] --> - <string name="osu_failure_service_provider_verification">Invalid OSU server certificate</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_PROVISIONING_ABORTED. [CHAR LIMIT=NONE] --> - <string name="osu_failure_provisioning_aborted">Provisioning aborted</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_PROVISIONING_NOT_AVAILABLE. [CHAR LIMIT=NONE] --> - <string name="osu_failure_provisioning_not_available">Provisioning not available</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_INVALID_SERVER_URL. [CHAR LIMIT=NONE] --> - <string name="osu_failure_invalid_server_url">Invalid OSU server URL</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_UNEXPECTED_COMMAND_TYPE. [CHAR LIMIT=NONE] --> - <string name="osu_failure_unexpected_command_type">Unexpected command type</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE. [CHAR LIMIT=NONE] --> - <string name="osu_failure_unexpected_soap_message_type">Unexpected SOAP message type</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_SOAP_MESSAGE_EXCHANGE. [CHAR LIMIT=NONE] --> - <string name="osu_failure_soap_message_exchange">SOAP message exchange failed</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_START_REDIRECT_LISTENER. [CHAR LIMIT=NONE] --> - <string name="osu_failure_start_redirect_listener">Redirect listener failed to start</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER. [CHAR LIMIT=NONE] --> - <string name="osu_failure_timed_out_redirect_listener">Timed out waiting for redirect</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_NO_OSU_ACTIVITY_FOUND. [CHAR LIMIT=NONE] --> - <string name="osu_failure_no_osu_activity_found">No OSU activity found</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS. [CHAR LIMIT=NONE] --> - <string name="osu_failure_unexpected_soap_message_status">Unexpected SOAP message status</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_NO_PPS_MO. [CHAR LIMIT=NONE] --> - <string name="osu_failure_no_pps_mo">Failed to find PPS-MO</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE. [CHAR LIMIT=NONE] --> - <string name="osu_failure_no_aaa_server_trust_root_node">Failed to find trust root node for AAA server</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE. [CHAR LIMIT=NONE] --> - <string name="osu_failure_no_remediation_server_trust_root_node">Failed to find trust root node for remediation server</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE. [CHAR LIMIT=NONE] --> - <string name="osu_failure_no_policy_server_trust_root_node">Failed to find trust root node for policy server</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES. [CHAR LIMIT=NONE] --> - <string name="osu_failure_retrieve_trust_root_certificates">Failed to retrieve trust root certificates</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE. [CHAR LIMIT=NONE] --> - <string name="osu_failure_no_aaa_trust_root_certificate">Failed to find trust root certificate for AAA server</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION. [CHAR LIMIT=NONE] --> - <string name="osu_failure_add_passpoint_configuration">Failed to add PassPoint configuration</string> - <!-- Status message of OSU Provider on receiving OSU_FAILURE_OSU_PROVIDER_NOT_FOUND. [CHAR LIMIT=NONE] --> - <string name="osu_failure_osu_provider_not_found">Failed to find an OSU provider</string> - - <!-- Status message of OSU Provider on receiving OSU_STATUS_AP_CONNECTING. [CHAR LIMIT=NONE] --> - <string name="osu_status_ap_connecting">Connecting</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_AP_CONNECTED. [CHAR LIMIT=NONE] --> - <string name="osu_status_ap_connected">Connected</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_SERVER_CONNECTING. [CHAR LIMIT=NONE] --> - <string name="osu_status_server_connecting">Connecting to OSU server</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_SERVER_VALIDATED. [CHAR LIMIT=NONE] --> - <string name="osu_status_server_validated">OSU server validated</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_SERVER_CONNECTED. [CHAR LIMIT=NONE] --> - <string name="osu_status_server_connected">Connected to OSU server</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_INIT_SOAP_EXCHANGE. [CHAR LIMIT=NONE] --> - <string name="osu_status_init_soap_exchange">Initial SOAP exchange</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_WAITING_FOR_REDIRECT_RESPONSE. [CHAR LIMIT=NONE] --> - <string name="osu_status_waiting_for_redirect_response">Waiting for redirect response</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_REDIRECT_RESPONSE_RECEIVED. [CHAR LIMIT=NONE] --> - <string name="osu_status_redirect_response_received">Received redirect response</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_SECOND_SOAP_EXCHANGE. [CHAR LIMIT=NONE] --> - <string name="osu_status_second_soap_exchange">Second SOAP exchange</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_THIRD_SOAP_EXCHANGE. [CHAR LIMIT=NONE] --> - <string name="osu_status_third_soap_exchange">Third SOAP exchange</string> - <!-- Status message of OSU Provider on receiving OSU_STATUS_RETRIEVING_TRUST_ROOT_CERTS. [CHAR LIMIT=NONE] --> - <string name="osu_status_retrieving_trust_root_certs">Retrieving trust root certificates</string> - + <!-- Status message of OSU Provider upon initiating provisioning flow [CHAR LIMIT=NONE] --> + <string name="osu_opening_provider">Opening <xliff:g id="passpointProvider" example="Passpoint Provider">%1$s</xliff:g></string> + <!-- Status message of OSU Provider when connection fails [CHAR LIMIT=NONE] --> + <string name="osu_connect_failed">Couldn\u2019t connect</string> + <!-- Status message of OSU Provider after user completes provisioning flow [CHAR LIMIT=NONE] --> + <string name="osu_completing_sign_up">Completing sign-up\u2026</string> + <!-- Status message of OSU Provider when sign up could not be completed [CHAR LIMIT=NONE] --> + <string name="osu_sign_up_failed">Couldn\u2019t complete sign-up. Tap to try again.</string> <!-- Status message of OSU Provider on completing provisioning. [CHAR LIMIT=NONE] --> - <string name="osu_provisioning_complete">Provisioning complete</string> + <string name="osu_sign_up_complete">Sign-up complete. Connecting\u2026</string> <!-- Speed label for very slow network speed --> <string name="speed_label_very_slow">Very Slow</string> diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java index 9b12a31dc149..c59842c031c7 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java @@ -888,13 +888,13 @@ public class AccessPoint implements Comparable<AccessPoint> { if (isOsuProvider()) { if (mOsuProvisioningComplete) { - summary.append(mContext.getString(R.string.osu_provisioning_complete)); + summary.append(mContext.getString(R.string.osu_sign_up_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)); + summary.append(mContext.getString(R.string.tap_to_sign_up)); } } else if (isActive()) { if (isPasspoint()) { @@ -1528,91 +1528,12 @@ public class AccessPoint implements Comparable<AccessPoint> { * All methods are invoked on the Main Thread */ private class AccessPointProvisioningCallback extends ProvisioningCallback { - // TODO: Remove logs and implement summary changing logic for these provisioning callbacks. @Override @MainThread public void onProvisioningFailure(int status) { - switch (status) { - case OSU_FAILURE_AP_CONNECTION: - mOsuFailure = mContext.getString(R.string.osu_failure_ap_connection); - break; - case OSU_FAILURE_SERVER_URL_INVALID: - mOsuFailure = mContext.getString(R.string.osu_failure_server_url_invalid); - break; - case OSU_FAILURE_SERVER_CONNECTION: - mOsuFailure = mContext.getString(R.string.osu_failure_server_connection); - break; - case OSU_FAILURE_SERVER_VALIDATION: - mOsuFailure = mContext.getString(R.string.osu_failure_server_validation); - break; - case OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION: - mOsuFailure = mContext.getString( - R.string.osu_failure_service_provider_verification); - break; - case OSU_FAILURE_PROVISIONING_ABORTED: - mOsuFailure = mContext.getString(R.string.osu_failure_provisioning_aborted); - break; - case OSU_FAILURE_PROVISIONING_NOT_AVAILABLE: - mOsuFailure = mContext.getString( - R.string.osu_failure_provisioning_not_available); - break; - case OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU: - mOsuFailure = mContext.getString(R.string.osu_failure_invalid_server_url); - break; - case OSU_FAILURE_UNEXPECTED_COMMAND_TYPE: - mOsuFailure = mContext.getString(R.string.osu_failure_unexpected_command_type); - break; - case OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE: - mOsuFailure = mContext.getString( - R.string.osu_failure_unexpected_soap_message_type); - break; - case OSU_FAILURE_SOAP_MESSAGE_EXCHANGE: - mOsuFailure = mContext.getString(R.string.osu_failure_soap_message_exchange); - break; - case OSU_FAILURE_START_REDIRECT_LISTENER: - mOsuFailure = mContext.getString(R.string.osu_failure_start_redirect_listener); - break; - case OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER: - mOsuFailure = mContext.getString( - R.string.osu_failure_timed_out_redirect_listener); - break; - case OSU_FAILURE_NO_OSU_ACTIVITY_FOUND: - mOsuFailure = mContext.getString(R.string.osu_failure_no_osu_activity_found); - break; - case OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS: - mOsuFailure = mContext.getString( - R.string.osu_failure_unexpected_soap_message_status); - break; - case OSU_FAILURE_NO_PPS_MO: - mOsuFailure = mContext.getString( - R.string.osu_failure_no_pps_mo); - break; - case OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE: - mOsuFailure = mContext.getString( - R.string.osu_failure_no_aaa_server_trust_root_node); - break; - case OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE: - mOsuFailure = mContext.getString( - R.string.osu_failure_no_remediation_server_trust_root_node); - break; - case OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE: - mOsuFailure = mContext.getString( - R.string.osu_failure_no_policy_server_trust_root_node); - break; - case OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES: - mOsuFailure = mContext.getString( - R.string.osu_failure_retrieve_trust_root_certificates); - break; - case OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE: - mOsuFailure = mContext.getString( - R.string.osu_failure_no_aaa_trust_root_certificate); - break; - case OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION: - mOsuFailure = mContext.getString( - R.string.osu_failure_add_passpoint_configuration); - break; - case OSU_FAILURE_OSU_PROVIDER_NOT_FOUND: - mOsuFailure = mContext.getString(R.string.osu_failure_osu_provider_not_found); - break; + if (TextUtils.equals(mOsuStatus, mContext.getString(R.string.osu_completing_sign_up))) { + mOsuFailure = mContext.getString(R.string.osu_sign_up_failed); + } else { + mOsuFailure = mContext.getString(R.string.osu_connect_failed); } mOsuStatus = null; mOsuProvisioningComplete = false; @@ -1625,50 +1546,37 @@ public class AccessPoint implements Comparable<AccessPoint> { @Override @MainThread public void onProvisioningStatus(int status) { + String newStatus = null; switch (status) { case OSU_STATUS_AP_CONNECTING: - mOsuStatus = mContext.getString(R.string.osu_status_ap_connecting); - break; case OSU_STATUS_AP_CONNECTED: - mOsuStatus = mContext.getString(R.string.osu_status_ap_connected); - break; case OSU_STATUS_SERVER_CONNECTING: - mOsuStatus = mContext.getString(R.string.osu_status_server_connecting); - break; case OSU_STATUS_SERVER_VALIDATED: - mOsuStatus = mContext.getString(R.string.osu_status_server_validated); - break; case OSU_STATUS_SERVER_CONNECTED: - mOsuStatus = mContext.getString(R.string.osu_status_server_connected); - break; case OSU_STATUS_INIT_SOAP_EXCHANGE: - mOsuStatus = mContext.getString(R.string.osu_status_init_soap_exchange); - break; case OSU_STATUS_WAITING_FOR_REDIRECT_RESPONSE: - mOsuStatus = mContext.getString( - R.string.osu_status_waiting_for_redirect_response); + newStatus = String.format(mContext.getString(R.string.osu_opening_provider), + mOsuProvider.getFriendlyName()); break; case OSU_STATUS_REDIRECT_RESPONSE_RECEIVED: - mOsuStatus = mContext.getString(R.string.osu_status_redirect_response_received); - break; case OSU_STATUS_SECOND_SOAP_EXCHANGE: - mOsuStatus = mContext.getString(R.string.osu_status_second_soap_exchange); - break; case OSU_STATUS_THIRD_SOAP_EXCHANGE: - mOsuStatus = mContext.getString(R.string.osu_status_third_soap_exchange); - break; case OSU_STATUS_RETRIEVING_TRUST_ROOT_CERTS: - mOsuStatus = mContext.getString( - R.string.osu_status_retrieving_trust_root_certs); + newStatus = mContext.getString( + R.string.osu_completing_sign_up); break; } + boolean updated = !TextUtils.equals(mOsuStatus, newStatus); + mOsuStatus = newStatus; mOsuFailure = null; mOsuProvisioningComplete = false; - ThreadUtils.postOnMainThread(() -> { - if (mAccessPointListener != null) { - mAccessPointListener.onAccessPointChanged(AccessPoint.this); - } - }); + if (updated) { + ThreadUtils.postOnMainThread(() -> { + if (mAccessPointListener != null) { + mAccessPointListener.onAccessPointChanged(AccessPoint.this); + } + }); + } } @Override |