summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2021-05-19 18:02:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-05-19 18:02:16 +0000
commitf07675c46cd7da0175891a1f14b403eefff8018f (patch)
tree5119f386240d5919c2a811b3f16c013d7a7345b7 /core/java
parent784886816ddcd2e6dfe5ac77d240154b5b9ede4e (diff)
parentd0c8e40b981ae6170123d92530ce66e14accc0e1 (diff)
Merge "Parcel: document enforceInterface" into sc-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/Parcel.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 5f5a910a74ac..50f390bce890 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -680,13 +680,20 @@ public final class Parcel {
/**
* Store or read an IBinder interface token in the parcel at the current
- * {@link #dataPosition}. This is used to validate that the marshalled
- * transaction is intended for the target interface.
+ * {@link #dataPosition}. This is used to validate that the marshalled
+ * transaction is intended for the target interface. This is typically written
+ * at the beginning of transactions as a header.
*/
public final void writeInterfaceToken(@NonNull String interfaceName) {
nativeWriteInterfaceToken(mNativePtr, interfaceName);
}
+ /**
+ * Read the header written by writeInterfaceToken and verify it matches
+ * the interface name in question. If the wrong interface type is present,
+ * {@link SecurityException} is thrown. When used over binder, this exception
+ * should propagate to the caller.
+ */
public final void enforceInterface(@NonNull String interfaceName) {
nativeEnforceInterface(mNativePtr, interfaceName);
}