Merge "set RuntimePermissionPresentationInfo, getAppPermissions, and OnGetAppPermissions as Test Api, added Get Runtime Permissions to shell" into qt-dev am: 1ce9983162 am: 40bcb1d3cd
am: 364c09f390
Change-Id: I26127032cd6185632d33e779e33cb7976b9ee2c1
diff --git a/api/test-current.txt b/api/test-current.txt
index 8b71fe2..11e0479 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -2198,6 +2198,7 @@
package android.permission {
public final class PermissionControllerManager {
+ method @RequiresPermission("android.permission.GET_RUNTIME_PERMISSIONS") public void getAppPermissions(@NonNull String, @NonNull android.permission.PermissionControllerManager.OnGetAppPermissionResultCallback, @Nullable android.os.Handler);
method @RequiresPermission("android.permission.REVOKE_RUNTIME_PERMISSIONS") public void revokeRuntimePermissions(@NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>, boolean, int, @NonNull java.util.concurrent.Executor, @NonNull android.permission.PermissionControllerManager.OnRevokeRuntimePermissionsCallback);
field public static final int COUNT_ONLY_WHEN_GRANTED = 1; // 0x1
field public static final int COUNT_WHEN_SYSTEM = 2; // 0x2
@@ -2205,11 +2206,25 @@
field public static final int REASON_MALWARE = 1; // 0x1
}
+ public static interface PermissionControllerManager.OnGetAppPermissionResultCallback {
+ method public void onGetAppPermissions(@NonNull java.util.List<android.permission.RuntimePermissionPresentationInfo>);
+ }
+
public abstract static class PermissionControllerManager.OnRevokeRuntimePermissionsCallback {
ctor public PermissionControllerManager.OnRevokeRuntimePermissionsCallback();
method public abstract void onRevokeRuntimePermissions(@NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>);
}
+ public final class RuntimePermissionPresentationInfo implements android.os.Parcelable {
+ ctor public RuntimePermissionPresentationInfo(@NonNull CharSequence, boolean, boolean);
+ method public int describeContents();
+ method @NonNull public CharSequence getLabel();
+ method public boolean isGranted();
+ method public boolean isStandard();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.permission.RuntimePermissionPresentationInfo> CREATOR;
+ }
+
}
package android.print {
diff --git a/core/java/android/permission/PermissionControllerManager.java b/core/java/android/permission/PermissionControllerManager.java
index 14932c6..d012ac7 100644
--- a/core/java/android/permission/PermissionControllerManager.java
+++ b/core/java/android/permission/PermissionControllerManager.java
@@ -157,6 +157,7 @@
*
* @hide
*/
+ @TestApi
public interface OnGetAppPermissionResultCallback {
/**
* The result for {@link #getAppPermissions(String, OnGetAppPermissionResultCallback,
@@ -456,6 +457,7 @@
*
* @hide
*/
+ @TestApi
@RequiresPermission(Manifest.permission.GET_RUNTIME_PERMISSIONS)
public void getAppPermissions(@NonNull String packageName,
@NonNull OnGetAppPermissionResultCallback callback, @Nullable Handler handler) {
diff --git a/core/java/android/permission/RuntimePermissionPresentationInfo.java b/core/java/android/permission/RuntimePermissionPresentationInfo.java
index 4fce14c..d696fea 100644
--- a/core/java/android/permission/RuntimePermissionPresentationInfo.java
+++ b/core/java/android/permission/RuntimePermissionPresentationInfo.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.os.Parcel;
import android.os.Parcelable;
@@ -32,6 +33,7 @@
*
* @hide
*/
+@TestApi
@SystemApi
public final class RuntimePermissionPresentationInfo implements Parcelable {
private static final int FLAG_GRANTED = 1 << 0;
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 4bb8f88..b9bbbef 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -22,7 +22,8 @@
android:sharedUserId="android.uid.shell"
>
- <!-- Standard permissions granted to the shell. -->
+ <!-- Standard permissions granted to the shell. -->
+ <uses-permission android:name="android.permission.GET_RUNTIME_PERMISSIONS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.CALL_PHONE" />