summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-03-17 19:27:52 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-03-17 19:27:52 +0000
commit8ba800fd3d9ba2389d911c6e6b891e2cd9df866e (patch)
tree07de9019a1a49700acfc2cc635ca1ec2e3aed947
parentcbe953924c36191d1dea16e591ce70f24a763a26 (diff)
parent700129680e87c4b10cdd908db1d07b3e4a00b8ad (diff)
downloadnative-8ba800fd3d9ba2389d911c6e6b891e2cd9df866e.tar.gz
Merge "libbinder: Document getCalling*"android-r-preview-4android-r-preview-3android-r-preview-2
-rw-r--r--libs/binder/include/binder/IPCThreadState.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/libs/binder/include/binder/IPCThreadState.h b/libs/binder/include/binder/IPCThreadState.h
index 4818889436..b4e4a428b5 100644
--- a/libs/binder/include/binder/IPCThreadState.h
+++ b/libs/binder/include/binder/IPCThreadState.h
@@ -39,12 +39,28 @@ public:
status_t clearLastError();
+ /**
+ * Returns the PID of the process which has made the current binder
+ * call. If not in a binder call, this will return getpid. If the
+ * call is oneway, this will return 0.
+ */
pid_t getCallingPid() const;
- // nullptr if unavailable
- //
- // this can't be restored once it's cleared, and it does not return the
- // context of the current process when not in a binder call.
+
+ /**
+ * Returns the SELinux security identifier of the process which has
+ * made the current binder call. If not in a binder call this will
+ * return nullptr. If this isn't requested with
+ * IBinder::setRequestingSid, it will also return nullptr.
+ *
+ * This can't be restored once it's cleared, and it does not return the
+ * context of the current process when not in a binder call.
+ */
const char* getCallingSid() const;
+
+ /**
+ * Returns the UID of the process which has made the current binder
+ * call. If not in a binder call, this will return 0.
+ */
uid_t getCallingUid() const;
void setStrictModePolicy(int32_t policy);