Loading core/java/android/os/Parcel.java +9 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,8 @@ public final class Parcel { private static native void nativeWriteInterfaceToken(long nativePtr, String interfaceName); private static native void nativeEnforceInterface(long nativePtr, String interfaceName); private static native long nativeGetAshmemSize(long nativePtr); public final static Parcelable.Creator<String> STRING_CREATOR = new Parcelable.Creator<String>() { public String createFromParcel(Parcel source) { Loading Loading @@ -2594,4 +2596,11 @@ public final class Parcel { N--; } } /** * @hide For testing */ public long getBlobAshmemSize() { return nativeGetBlobAshmemSize(mNativePtr); } } core/jni/android_os_Parcel.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -704,6 +704,15 @@ static jlong android_os_Parcel_getGlobalAllocCount(JNIEnv* env, jclass clazz) return Parcel::getGlobalAllocCount(); } static jlong android_os_Parcel_getBlobAshmemSize(JNIEnv* env, jclass clazz, jlong nativePtr) { Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr); if (parcel != NULL) { return parcel->getBlobAshmemSize(); } return 0; } // ---------------------------------------------------------------------------- static const JNINativeMethod gParcelMethods[] = { Loading Loading @@ -756,6 +765,8 @@ static const JNINativeMethod gParcelMethods[] = { {"getGlobalAllocSize", "()J", (void*)android_os_Parcel_getGlobalAllocSize}, {"getGlobalAllocCount", "()J", (void*)android_os_Parcel_getGlobalAllocCount}, {"nativeGetAshmemSize", "(J)J", (void*)android_os_Parcel_getAshmemSize}, }; const char* const kParcelPathName = "android/os/Parcel"; Loading Loading
core/java/android/os/Parcel.java +9 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,8 @@ public final class Parcel { private static native void nativeWriteInterfaceToken(long nativePtr, String interfaceName); private static native void nativeEnforceInterface(long nativePtr, String interfaceName); private static native long nativeGetAshmemSize(long nativePtr); public final static Parcelable.Creator<String> STRING_CREATOR = new Parcelable.Creator<String>() { public String createFromParcel(Parcel source) { Loading Loading @@ -2594,4 +2596,11 @@ public final class Parcel { N--; } } /** * @hide For testing */ public long getBlobAshmemSize() { return nativeGetBlobAshmemSize(mNativePtr); } }
core/jni/android_os_Parcel.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -704,6 +704,15 @@ static jlong android_os_Parcel_getGlobalAllocCount(JNIEnv* env, jclass clazz) return Parcel::getGlobalAllocCount(); } static jlong android_os_Parcel_getBlobAshmemSize(JNIEnv* env, jclass clazz, jlong nativePtr) { Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr); if (parcel != NULL) { return parcel->getBlobAshmemSize(); } return 0; } // ---------------------------------------------------------------------------- static const JNINativeMethod gParcelMethods[] = { Loading Loading @@ -756,6 +765,8 @@ static const JNINativeMethod gParcelMethods[] = { {"getGlobalAllocSize", "()J", (void*)android_os_Parcel_getGlobalAllocSize}, {"getGlobalAllocCount", "()J", (void*)android_os_Parcel_getGlobalAllocCount}, {"nativeGetAshmemSize", "(J)J", (void*)android_os_Parcel_getAshmemSize}, }; const char* const kParcelPathName = "android/os/Parcel"; Loading