Merge "doc getCallingPid zero return" into main am: 1b05f61bdb

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2871539

Change-Id: I19dbba35306786523ad573f3ada2a6517727aef7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java
index 218d4bb..0c753a5 100644
--- a/core/java/android/os/Binder.java
+++ b/core/java/android/os/Binder.java
@@ -309,7 +309,11 @@
      * 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();