OSDN Git Service

Document system activity intents that may not be implemented
authorChristopher Tate <ctate@google.com>
Thu, 10 May 2018 20:09:48 +0000 (13:09 -0700)
committerChristopher Tate <ctate@google.com>
Fri, 11 May 2018 00:55:26 +0000 (17:55 -0700)
All of these activity-start intents might be unimplemented on some
Android products.  Document this to make sure that developers are
aware of the need to safeguard against this.

Bug: 68300743
Bug: 62201251
Bug: 69587018
Fixes: 77282739
Test: atest CtsContentTestCases:.AvailableIntentsTest
Change-Id: Ia2346d03ccb7f2bdad2b84ba9efff72413fdc3c2

core/java/android/content/Intent.java
core/java/android/provider/Settings.java
core/java/android/speech/RecognizerIntent.java

index fe48975..ea08110 100644 (file)
@@ -1420,6 +1420,9 @@ public class Intent implements Parcelable, Cloneable {
      * Activity Action: Start Voice Command.
      * <p>Input: Nothing.
      * <p>Output: Nothing.
+     * <p class="note">
+     * In some cases, a matching Activity may not exist, so ensure you
+     * safeguard against this.
      */
     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
     public static final String ACTION_VOICE_COMMAND = "android.intent.action.VOICE_COMMAND";
index 8543b26..10ee728 100644 (file)
@@ -123,6 +123,10 @@ public final class Settings {
      * Input: Nothing.
      * <p>
      * Output: Nothing.
+     *
+     * <p class="note">
+     * In some cases, a matching Activity may not exist, so ensure you
+     * safeguard against this.
      */
     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
     public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
@@ -882,6 +886,10 @@ public final class Settings {
      * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
      * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
      * status of the background data restrictions for them.
+     *
+     * <p class="note">
+     * In some cases, a matching Activity may not exist, so ensure you
+     * safeguard against this.
      */
     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
     public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
@@ -1148,6 +1156,10 @@ public final class Settings {
      * Input: Nothing.
      * <p>
      * Output: Nothing.
+     *
+     * <p class="note">
+     * In some cases, a matching Activity may not exist, so ensure you
+     * safeguard against this.
      */
     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
index ce94315..362b94b 100644 (file)
@@ -141,6 +141,10 @@ public class RecognizerIntent {
      * <ul>
      *   <li>{@link #EXTRA_SECURE}
      * </ul>
+     *
+     * <p class="note">
+     * In some cases, a matching Activity may not exist, so ensure you
+     * safeguard against this.
      */
     public static final String ACTION_VOICE_SEARCH_HANDS_FREE =
             "android.speech.action.VOICE_SEARCH_HANDS_FREE";