diff options
| -rw-r--r-- | core/java/android/os/HwParcel.java | 1 | ||||
| -rw-r--r-- | core/jni/android_os_HwParcel.cpp | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/os/HwParcel.java b/core/java/android/os/HwParcel.java index a265dd08a92f..94fd5b074b82 100644 --- a/core/java/android/os/HwParcel.java +++ b/core/java/android/os/HwParcel.java @@ -219,6 +219,7 @@ public class HwParcel { public native final void writeStatus(int status); public native final void verifySuccess(); public native final void releaseTemporaryStorage(); + public native final void release(); public native final void send(); diff --git a/core/jni/android_os_HwParcel.cpp b/core/jni/android_os_HwParcel.cpp index 1bd233313ca3..678041f85d17 100644 --- a/core/jni/android_os_HwParcel.cpp +++ b/core/jni/android_os_HwParcel.cpp @@ -404,6 +404,11 @@ static void JHwParcel_native_verifySuccess(JNIEnv *env, jobject thiz) { signalExceptionForError(env, err); } +static void JHwParcel_native_release( + JNIEnv *env, jobject thiz) { + JHwParcel::GetNativeContext(env, thiz)->setParcel(NULL, false /* assumeOwnership */); +} + static void JHwParcel_native_releaseTemporaryStorage( JNIEnv *env, jobject thiz) { JHwParcel::GetNativeContext(env, thiz)->getStorage()->release(env); @@ -955,6 +960,10 @@ static JNINativeMethod gMethods[] = { { "writeBuffer", "(L" PACKAGE_PATH "/HwBlob;)V", (void *)JHwParcel_native_writeBuffer }, + + { "release", "()V", + (void *)JHwParcel_native_release }, + }; namespace android { |