OSDN Git Service

Define a category for "file management" apps.
authorJeff Sharkey <jsharkey@android.com>
Tue, 9 Apr 2019 15:23:48 +0000 (09:23 -0600)
committerJeff Sharkey <jsharkey@android.com>
Tue, 9 Apr 2019 15:30:19 +0000 (09:30 -0600)
We already have a nice collection of CATEGORY_APP_* constants that
can be used to identify classes of apps.  This change expands that
list to discover file management apps, such as DocumentsUI.

Bug: 130215653
Test: none
Change-Id: I9b5016676ca1526074ba876675f14bf814ea4c09

api/current.txt
core/java/android/content/Intent.java

index 5997043..bc634c6 100644 (file)
@@ -10307,6 +10307,7 @@ package android.content {
     field public static final String CATEGORY_APP_CALENDAR = "android.intent.category.APP_CALENDAR";
     field public static final String CATEGORY_APP_CONTACTS = "android.intent.category.APP_CONTACTS";
     field public static final String CATEGORY_APP_EMAIL = "android.intent.category.APP_EMAIL";
+    field public static final String CATEGORY_APP_FILES = "android.intent.category.APP_FILES";
     field public static final String CATEGORY_APP_GALLERY = "android.intent.category.APP_GALLERY";
     field public static final String CATEGORY_APP_MAPS = "android.intent.category.APP_MAPS";
     field public static final String CATEGORY_APP_MARKET = "android.intent.category.APP_MARKET";
index d87171e..8628d32 100644 (file)
@@ -4731,6 +4731,18 @@ public class Intent implements Parcelable, Cloneable {
     @SdkConstant(SdkConstantType.INTENT_CATEGORY)
     public static final String CATEGORY_APP_MUSIC = "android.intent.category.APP_MUSIC";
 
+    /**
+     * Used with {@link #ACTION_MAIN} to launch the files application.
+     * The activity should be able to browse and manage files stored on the device.
+     * <p>NOTE: This should not be used as the primary key of an Intent,
+     * since it will not result in the app launching with the correct
+     * action and category.  Instead, use this with
+     * {@link #makeMainSelectorActivity(String, String)} to generate a main
+     * Intent with this category in the selector.</p>
+     */
+    @SdkConstant(SdkConstantType.INTENT_CATEGORY)
+    public static final String CATEGORY_APP_FILES = "android.intent.category.APP_FILES";
+
     // ---------------------------------------------------------------------
     // ---------------------------------------------------------------------
     // Standard extra data keys.