summaryrefslogtreecommitdiff
path: root/core/java/android/content/PermissionChecker.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/content/PermissionChecker.java')
-rw-r--r--core/java/android/content/PermissionChecker.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/core/java/android/content/PermissionChecker.java b/core/java/android/content/PermissionChecker.java
index eec7c9cc5a63..159db92c79c9 100644
--- a/core/java/android/content/PermissionChecker.java
+++ b/core/java/android/content/PermissionChecker.java
@@ -116,6 +116,10 @@ public final class PermissionChecker {
* will evaluate the permission access based on the current fg/bg state of the app and
* leave a record that the data was accessed.
*
+ * <p>For more details how to determine the {@code packageName}, {@code attributionTag}, and
+ * {@code message}, please check the description in
+ * {@link AppOpsManager#noteOp(String, int, String, String, String)}
+ *
* @param context Context for accessing resources.
* @param permission The permission to check.
* @param pid The process id for which to check. Use {@link #PID_UNKNOWN} if the PID
@@ -262,11 +266,15 @@ public final class PermissionChecker {
* will evaluate the permission access based on the current fg/bg state of the app and
* leave a record that the data was accessed.
*
+ * <p>For more details how to determine the {@code callingPackageName},
+ * {@code callingAttributionTag}, and {@code message}, please check the description in
+ * {@link AppOpsManager#noteOp(String, int, String, String, String)}
+ *
* @param context Context for accessing resources.
* @param permission The permission to check.
- * @param packageName The package name making the IPC. If null the
+ * @param callingPackageName The package name making the IPC. If null the
* the first package for the calling UID will be used.
- * @param attributionTag attribution tag
+ * @param callingAttributionTag attribution tag
* @return The permission check result which is either {@link #PERMISSION_GRANTED}
* or {@link #PERMISSION_SOFT_DENIED} or {@link #PERMISSION_HARD_DENIED}.
* @param message A message describing the reason the permission was checked
@@ -275,13 +283,13 @@ public final class PermissionChecker {
*/
@PermissionResult
public static int checkCallingPermissionForDataDelivery(@NonNull Context context,
- @NonNull String permission, @Nullable String packageName,
- @Nullable String attributionTag, @Nullable String message) {
+ @NonNull String permission, @Nullable String callingPackageName,
+ @Nullable String callingAttributionTag, @Nullable String message) {
if (Binder.getCallingPid() == Process.myPid()) {
return PERMISSION_HARD_DENIED;
}
return checkPermissionForDataDelivery(context, permission, Binder.getCallingPid(),
- Binder.getCallingUid(), packageName, attributionTag, message);
+ Binder.getCallingUid(), callingPackageName, callingAttributionTag, message);
}
/**
@@ -339,6 +347,10 @@ public final class PermissionChecker {
* will evaluate the permission access based on the current fg/bg state of the app and
* leave a record that the data was accessed.
*
+ * <p>For more details how to determine the {@code callingPackageName},
+ * {@code callingAttributionTag}, and {@code message}, please check the description in
+ * {@link AppOpsManager#noteOp(String, int, String, String, String)}
+ *
* @param context Context for accessing resources.
* @param permission The permission to check.
* @return The permission check result which is either {@link #PERMISSION_GRANTED}