From 81a356ed8da968cbe7813377d14415923584159c Mon Sep 17 00:00:00 2001 From: Salvador Martinez Date: Wed, 9 Jan 2019 18:50:24 -0800 Subject: [PATCH] Create public intent for dpp configurator activity This makes it so 3rd party apps can start this activity directly. They must still provide the needed extras though. Test: CTS test Bug: 122983054 Change-Id: I54fb02ee99abf49a317e9288bc373686d970a1a2 --- api/current.txt | 2 ++ core/java/android/provider/Settings.java | 31 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/api/current.txt b/api/current.txt index 36cf96b84b762..36dba72b25a70 100644 --- a/api/current.txt +++ b/api/current.txt @@ -38582,6 +38582,7 @@ package android.provider { field public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; field public static final String ACTION_PRINT_SETTINGS = "android.settings.ACTION_PRINT_SETTINGS"; field public static final String ACTION_PRIVACY_SETTINGS = "android.settings.PRIVACY_SETTINGS"; + field public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE = "android.settings.PROCESS_WIFI_EASY_CONNECT_QR_CODE"; field public static final String ACTION_QUICK_LAUNCH_SETTINGS = "android.settings.QUICK_LAUNCH_SETTINGS"; field public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; field public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; @@ -38615,6 +38616,7 @@ package android.provider { field public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = "android.settings.extra.do_not_disturb_mode_enabled"; field public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = "android.settings.extra.do_not_disturb_mode_minutes"; field public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; + field public static final String EXTRA_QR_CODE = "android.provider.extra.QR_CODE"; field public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID"; field public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = "android.intent.category.USAGE_ACCESS_CONFIG"; field public static final String METADATA_USAGE_ACCESS_REASON = "android.settings.metadata.USAGE_ACCESS_REASON"; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 618fbd07ad9e4..34a3cc5c86f77 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -485,6 +485,37 @@ public final class Settings { public static final String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_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. + *

+ * In some cases, a matching Activity may not exist, so ensure you safeguard + * against this by checking WifiManager.isEasyConnectSupported(); + *

+ * Input: + * The following keys in the bundle with their associated value. + *

+ *

+ * Output: Nothing. + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE = + "android.settings.PROCESS_WIFI_EASY_CONNECT_QR_CODE"; + + /** + * An extra to put in the bundle for {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE} intents. + * It must contain properly formatted Easy Connect (Wi-Fi DPP) URI bootstrapping information for + * the process to proceed. + */ + public static final String EXTRA_QR_CODE = "android.provider.extra.QR_CODE"; + /** * Activity Action: Show settings to allow configuration of data and view data usage. *