diff --git a/api/current.txt b/api/current.txt index 8b24826a267bc..54fb459b3bc87 100644 --- a/api/current.txt +++ b/api/current.txt @@ -143,6 +143,7 @@ package android { field public static final String SET_WALLPAPER_HINTS = "android.permission.SET_WALLPAPER_HINTS"; field public static final String SIGNAL_PERSISTENT_PROCESSES = "android.permission.SIGNAL_PERSISTENT_PROCESSES"; field public static final String SMS_FINANCIAL_TRANSACTIONS = "android.permission.SMS_FINANCIAL_TRANSACTIONS"; + field public static final String START_VIEW_PERMISSION_USAGE = "android.permission.START_VIEW_PERMISSION_USAGE"; field public static final String STATUS_BAR = "android.permission.STATUS_BAR"; field public static final String SYSTEM_ALERT_WINDOW = "android.permission.SYSTEM_ALERT_WINDOW"; field public static final String TRANSMIT_IR = "android.permission.TRANSMIT_IR"; @@ -10326,6 +10327,7 @@ package android.content { field public static final String ACTION_USER_UNLOCKED = "android.intent.action.USER_UNLOCKED"; field public static final String ACTION_VIEW = "android.intent.action.VIEW"; field public static final String ACTION_VIEW_LOCUS = "android.intent.action.VIEW_LOCUS"; + field @RequiresPermission(android.Manifest.permission.START_VIEW_PERMISSION_USAGE) public static final String ACTION_VIEW_PERMISSION_USAGE = "android.intent.action.VIEW_PERMISSION_USAGE"; field public static final String ACTION_VOICE_COMMAND = "android.intent.action.VOICE_COMMAND"; field @Deprecated public static final String ACTION_WALLPAPER_CHANGED = "android.intent.action.WALLPAPER_CHANGED"; field public static final String ACTION_WEB_SEARCH = "android.intent.action.WEB_SEARCH"; diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 50d1785c60596..9e5fcfb6f73e9 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -1880,6 +1880,31 @@ public class Intent implements Parcelable, Cloneable { public static final String ACTION_REVIEW_PERMISSIONS = "android.intent.action.REVIEW_PERMISSIONS"; + /** + * Activity action: Launch UI to show information about the usage + * of a given permission. This action would be handled by apps that + * want to show details about how and why given permission is being + * used. + *

+ * Important:You must protect the activity that handles + * this action with the {@link android.Manifest.permission#START_VIEW_PERMISSION_USAGE + * START_VIEW_PERMISSION_USAGE} permission to ensure that only the + * system can launch this activity. The system will not launch + * activities that are not properly protected. + * + *

+ * Input: {@code android.intent.extra.PERMISSION_NAME} specifies the permission + * for which the launched UI would be targeted. + *

+ *

+ * Output: Nothing. + *

+ */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + @RequiresPermission(android.Manifest.permission.START_VIEW_PERMISSION_USAGE) + public static final String ACTION_VIEW_PERMISSION_USAGE = + "android.intent.action.VIEW_PERMISSION_USAGE"; + /** * Activity action: Launch UI to manage a default app. *

diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 57b7704558171..b634bb2a6e9ee 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -4213,6 +4213,15 @@ android:description="@string/permdesc_bindCarrierServices" android:protectionLevel="signature|privileged" /> + + + diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 5652c85cf28fd..0cf9500430791 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -1726,6 +1726,11 @@ Allows the app to read and write Do Not Disturb configuration. + + start view permission usage + + Allows the holder to start the permission usage for an app. Should never be needed for normal apps. +