Merge "Add an API for launching intent to view permission usage." into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-14 13:24:56 +00:00
committed by Android (Google) Code Review
4 changed files with 41 additions and 0 deletions

View File

@@ -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";

View File

@@ -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.
* <p>
* <strong>Important:</strong>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.
*
* <p>
* Input: {@code android.intent.extra.PERMISSION_NAME} specifies the permission
* for which the launched UI would be targeted.
* </p>
* <p>
* Output: Nothing.
* </p>
*/
@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.
* <p>

View File

@@ -4213,6 +4213,15 @@
android:description="@string/permdesc_bindCarrierServices"
android:protectionLevel="signature|privileged" />
<!--
Allows the holder to start the permission usage screen for an app.
<p>Protection level: signature|installer
-->
<permission android:name="android.permission.START_VIEW_PERMISSION_USAGE"
android:label="@string/permlab_startViewPermissionUsage"
android:description="@string/permdesc_startViewPermissionUsage"
android:protectionLevel="signature|installer" />
<!-- Allows an application to query whether DO_NOT_ASK_CREDENTIALS_ON_BOOT
flag is set.
@hide -->

View File

@@ -1726,6 +1726,11 @@
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_access_notification_policy">Allows the app to read and write Do Not Disturb configuration.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_startViewPermissionUsage">start view permission usage</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_startViewPermissionUsage">Allows the holder to start the permission usage for an app. Should never be needed for normal apps.</string>
<!-- Policy administration -->
<!-- Title of policy access to limiting the user's password choices -->