From 07fe4828353e153cfa8e1edd92409bf8d3a5c05e Mon Sep 17 00:00:00 2001 From: Linus Tufvesson Date: Tue, 8 Dec 2020 14:16:20 +0000 Subject: [PATCH] Update javadoc for adoptShellPermissionIdentity Fixes: 174484432 Test: javadoc only Change-Id: I16cdffef36aa7d2acfd31e512ba8c262f6e04b8e --- core/java/android/app/UiAutomation.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/java/android/app/UiAutomation.java b/core/java/android/app/UiAutomation.java index 787393ed0f6ce..05872bad30f07 100644 --- a/core/java/android/app/UiAutomation.java +++ b/core/java/android/app/UiAutomation.java @@ -438,8 +438,8 @@ public final class UiAutomation { * Adopt the permission identity of the shell UID for all permissions. This allows * you to call APIs protected permissions which normal apps cannot hold but are * granted to the shell UID. If you already adopted all shell permissions by calling - * this method or {@link #adoptShellPermissionIdentity(String...)} a subsequent call - * would be a no-op. Note that your permission state becomes that of the shell UID + * this method or {@link #adoptShellPermissionIdentity(String...)} a subsequent call will + * replace any previous adoption. Note that your permission state becomes that of the shell UID * and it is not a combination of your and the shell UID permissions. *

* Note: Calling this method adopts all shell permissions and overrides @@ -460,13 +460,13 @@ public final class UiAutomation { /** * Adopt the permission identity of the shell UID only for the provided permissions. * This allows you to call APIs protected permissions which normal apps cannot hold - * but are granted to the shell UID. If you already adopted the specified shell - * permissions by calling this method or {@link #adoptShellPermissionIdentity()} a - * subsequent call would be a no-op. Note that your permission state becomes that of the - * shell UID and it is not a combination of your and the shell UID permissions. + * but are granted to the shell UID. If you already adopted shell permissions by calling + * this method, or {@link #adoptShellPermissionIdentity()} a subsequent call will replace any + * previous adoption. *

- * Note: Calling this method adopts only the specified shell permissions - * and overrides all adopted permissions via {@link #adoptShellPermissionIdentity()}. + * Note: This method behave differently from + * {@link #adoptShellPermissionIdentity()}. Only the listed permissions will use the shell + * identity and other permissions will still check against the original UID * * @param permissions The permissions to adopt or null to adopt all. *