summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2023-12-13 01:50:03 +0000
committer Martijn Coenen <maco@google.com> 2023-12-14 07:35:23 +0000
commit910c4f25d7ce7e0f6d74dd7662355a76ffbcf6e2 (patch)
treea6cf741ae8b82d27a396b02aa7196f34b6ae7067
parentdff1d0ff15ee595effd4cab67b6150a594f0c4a5 (diff)
doc getCallingPid zero return
Bug: 297833427 Test: N/A Change-Id: I8bd480d7deb74062f3aaf61f30b1335443f82653
-rw-r--r--core/java/android/os/Binder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java
index 218d4bb8514f..0c753a51c508 100644
--- a/core/java/android/os/Binder.java
+++ b/core/java/android/os/Binder.java
@@ -309,7 +309,11 @@ public class Binder implements IBinder {
* If the current thread is not currently executing an incoming transaction,
* then its own PID is returned.
*
- * Warning: oneway transactions do not receive PID.
+ * Warning: oneway transactions do not receive PID. Even if you expect
+ * a transaction to be synchronous, a misbehaving client could send it
+ * as a asynchronous call and result in a 0 PID here. Additionally, if
+ * there is a race and the calling process dies, the PID may still be
+ * 0 for a synchronous call.
*/
@CriticalNative
public static final native int getCallingPid();