summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-12-26 19:19:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-12-26 19:19:54 +0000
commit032c3aa77e3d397c2192967baf42d0858bdeb3b1 (patch)
tree9c9b538420126ecda50350b96a3730089bd58a24 /core/java/android
parent1063eccd69e94b32b42db14739ca11b3ff97addd (diff)
parent7cd8e71494f48344cfb0dea5e9a0037fa8764cf2 (diff)
Merge "[DPP R2] Update ACTION_PROCESS_WIFI_EASY_CONNECT_URI intent"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/provider/Settings.java83
1 files changed, 76 insertions, 7 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 462627e08520..588bb18a7984 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -494,25 +494,94 @@ public final class Settings {
* Activity Action: Show setting page to process an Easy Connect (Wi-Fi DPP) QR code and start
* configuration. This intent should be used when you want to use this device to take on the
* configurator role for an IoT/other device. When provided with a valid DPP URI string Settings
- * will open a wifi selection screen for the user to indicate which network they would like
- * to configure the device specified in the DPP URI string for and carry them through the rest
- * of the flow for provisioning the device.
+ * will open a wifi selection screen for the user to indicate which network they would like to
+ * configure the device specified in the DPP URI string for and carry them through the rest of
+ * the flow for provisioning the device.
* <p>
- * In some cases, a matching Activity may not exist, so ensure you safeguard
- * against this by checking WifiManager.isEasyConnectSupported();
+ * In some cases, a matching Activity may not exist, so ensure you safeguard against this by
+ * checking WifiManager.isEasyConnectSupported();
* <p>
* Input: The Intent's data URI specifies bootstrapping information for authenticating and
* provisioning the peer, with the "DPP" scheme.
* <p>
* Output: After {@code startActivityForResult}, the callback {@code onActivityResult} will have
- * resultCode {@link android.app.Activity#RESULT_OK} if Wi-Fi Easy Connect configuration
- * success and the user clicks 'Done' button.
+ * resultCode {@link android.app.Activity#RESULT_OK} if Wi-Fi Easy Connect configuration succeeded
+ * and the user tapped 'Done' button, or {@link android.app.Activity#RESULT_CANCELED} if operation
+ * failed and user tapped 'Cancel'. In case the operation has failed, a status code from {@link
+ * android.net.wifi.EasyConnectStatusCallback.EasyConnectFailureStatusCode} will be returned as
+ * Extra {@link #EXTRA_EASY_CONNECT_ERROR_CODE}. Easy Connect R2 Enrollees report additional
+ * details about the error they encountered, which will be provided in the {@link
+ * #EXTRA_EASY_CONNECT_ATTEMPTED_SSID}, {@link #EXTRA_EASY_CONNECT_CHANNEL_LIST}, and {@link
+ * #EXTRA_EASY_CONNECT_BAND_LIST}.
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI =
"android.settings.PROCESS_WIFI_EASY_CONNECT_URI";
/**
+ * Activity Extra: The Easy Connect operation error code
+ * <p>
+ * An extra returned on the result intent received when using the {@link
+ * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
+ * extra contains the error code of the operation - one of
+ * {@link android.net.wifi.EasyConnectStatusCallback.EasyConnectFailureStatusCode}.
+ * If there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK},
+ * then this extra is not attached to the result intent.
+ */
+ public static final String EXTRA_EASY_CONNECT_ERROR_CODE =
+ "android.provider.extra.EASY_CONNECT_ERROR_CODE";
+
+ /**
+ * Activity Extra: The SSID that the Enrollee tried to connect to.
+ * <p>
+ * An extra returned on the result intent received when using the {@link
+ * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
+ * extra contains the SSID of the Access Point that the remote Enrollee tried to connect to.
+ * This value is populated only by remote R2 devices, and only for the following error codes:
+ * {@link android.net.wifi.EasyConnectStatusCallback.EasyConnectFailureStatusCode#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}
+ * {@link android.net.wifi.EasyConnectStatusCallback.EasyConnectFailureStatusCode#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}.
+ * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
+ * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
+ * this extra is not attached to the result intent.
+ */
+ public static final String EXTRA_EASY_CONNECT_ATTEMPTED_SSID =
+ "android.provider.extra.EASY_CONNECT_ATTEMPTED_SSID";
+
+ /**
+ * Activity Extra: The Channel List that the Enrollee used to scan a network.
+ * <p>
+ * An extra returned on the result intent received when using the {@link
+ * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
+ * extra contains the list channels the Enrollee used to scan for a network. This value is
+ * populated only by remote R2 devices, and only for the following error code: {@link
+ * android.net.wifi.EasyConnectStatusCallback.EasyConnectFailureStatusCode#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}.
+ * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
+ * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
+ * this extra is not attached to the result intent. The list is JSON formatted, as an array
+ * (Wi-Fi global operating classes) of arrays (Wi-Fi channels).
+ */
+ public static final String EXTRA_EASY_CONNECT_CHANNEL_LIST =
+ "android.provider.extra.EASY_CONNECT_CHANNEL_LIST";
+
+ /**
+ * Activity Extra: The Band List that the Enrollee supports.
+ * <p>
+ * An extra returned on the result intent received when using the {@link
+ * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
+ * extra contains the bands the Enrollee supports, expressed as the Global Operating Class,
+ * see Table E-4 in IEEE Std 802.11-2016 -Global operating classes. This value is populated only
+ * by remote R2 devices, and only for the following error codes: {@link
+ * android.net.wifi.EasyConnectStatusCallback.EasyConnectFailureStatusCode#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}
+ * {@link android.net.wifi.EasyConnectStatusCallback.EasyConnectFailureStatusCode#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}
+ * {@link android.net.wifi.EasyConnectStatusCallback.EasyConnectFailureStatusCode#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION}.
+ * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
+ * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
+ * this extra is not attached to the result intent.
+ */
+ public static final String EXTRA_EASY_CONNECT_BAND_LIST =
+ "android.provider.extra.EASY_CONNECT_BAND_LIST";
+
+ /**
* Activity Action: Show settings to allow configuration of data and view data usage.
* <p>
* In some cases, a matching Activity may not exist, so ensure you