summaryrefslogtreecommitdiff
path: root/core/java/android/os
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2020-11-11 18:23:53 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-11-11 18:23:53 +0000
commitb908d8a2eeca9828a098bb130dd7d7b026703290 (patch)
treef11fa42d6398f92d759deb54b69820a99c1f6620 /core/java/android/os
parent9b6b26563e4f1aacc91cc6a35ab93e8d8e930e0b (diff)
parent951299fb04007ab4b55c73f91e899a0e04665e6e (diff)
Merge "IBinder: support FLAG_CLEAR_BUF" am: 9910d9980e am: dcae11d0ef am: 951299fb04
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1477120 Change-Id: Id0c58b52a83187d6e9eeb6be2bc730c8a3c7f016
Diffstat (limited to 'core/java/android/os')
-rw-r--r--core/java/android/os/IBinder.java9
-rw-r--r--core/java/android/os/Parcel.java10
2 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/os/IBinder.java b/core/java/android/os/IBinder.java
index d91c458a474b..010459d06e8d 100644
--- a/core/java/android/os/IBinder.java
+++ b/core/java/android/os/IBinder.java
@@ -170,6 +170,15 @@ public interface IBinder {
int FLAG_ONEWAY = 0x00000001;
/**
+ * Flag to {@link #transact}: request binder driver to clear transaction data.
+ *
+ * Be very careful when using this flag in Java, since Java objects read from a Java
+ * Parcel may be non-trivial to clear.
+ * @hide
+ */
+ int FLAG_CLEAR_BUF = 0x00000020;
+
+ /**
* @hide
*/
int FLAG_COLLECT_NOTED_APP_OPS = 0x00000002;
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 9c7f8be6526b..cf90174924f1 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -277,6 +277,8 @@ public final class Parcel {
private static final int EX_TRANSACTION_FAILED = -129;
@CriticalNative
+ private static native void nativeMarkSensitive(long nativePtr);
+ @CriticalNative
private static native int nativeDataSize(long nativePtr);
@CriticalNative
private static native int nativeDataAvail(long nativePtr);
@@ -491,6 +493,14 @@ public final class Parcel {
public static native long getGlobalAllocCount();
/**
+ * Parcel data should be zero'd before realloc'd or deleted.
+ * @hide
+ */
+ public final void markSensitive() {
+ nativeMarkSensitive(mNativePtr);
+ }
+
+ /**
* Returns the total amount of data contained in the parcel.
*/
public final int dataSize() {