summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author mrulhania <mrulhania@google.com> 2024-06-07 16:22:35 -0700
committer Manjeet Rulhania <mrulhania@google.com> 2024-06-07 23:33:13 +0000
commit8dfa151670fca1f137b3131f84f43aac2db73fe8 (patch)
tree0dd5a050b13ab0a2f15b0b879e6b62db4a0f4f61
parented81a1451b221065e890bb08ecf8878d9447e867 (diff)
Fix documentation for revokeSelfPermissionsOnKill API
Killing the app right after revokeSelfPermissionsOnKill prevents permission revocation as the IPC call is not yet completed due to async nature. Fix: 311557928 Test: build Change-Id: Id54eff506825f79583ec11b85b481bffc3b2b306
-rw-r--r--core/java/android/content/Context.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index bad73fc68f3a..4fcf6b66895c 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -7188,9 +7188,10 @@ public abstract class Context {
* as the package remains in the foreground, or has any active manifest components (e.g. when
* another app is accessing a content provider in the package).
* <p>
- * If you want to revoke the permissions right away, you could call {@code System.exit()}, but
- * this could affect other apps that are accessing your app at the moment. For example, apps
- * accessing a content provider in your app will all crash.
+ * If you want to revoke the permissions right away, you could call {@code System.exit()} in
+ * {@code Handler.postDelayed} with a delay to allow completion of async IPC, But
+ * {@code System.exit()} could affect other apps that are accessing your app at the moment.
+ * For example, apps accessing a content provider in your app will all crash.
* <p>
* Note that the settings UI shows a permission group as granted as long as at least one
* permission in the group is granted. If you want the user to observe the revocation in the