Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ef3dc86 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "getBlobAshmemSize -> getOpenAshmemSize" am: b146c8be am: ab857837

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1854070

Change-Id: Iafc23be921f28c084b6a5fecaadf60d8bf424a1f
parents 956294ef ab857837
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -401,7 +401,7 @@ public final class Parcel {
    private static final int WRITE_EXCEPTION_STACK_TRACE_THRESHOLD_MS = 1000;

    @CriticalNative
    private static native long nativeGetBlobAshmemSize(long nativePtr);
    private static native long nativeGetOpenAshmemSize(long nativePtr);

    public final static Parcelable.Creator<String> STRING_CREATOR
             = new Parcelable.Creator<String>() {
@@ -4381,8 +4381,8 @@ public final class Parcel {
    /**
     * @hide For testing
     */
    public long getBlobAshmemSize() {
        return nativeGetBlobAshmemSize(mNativePtr);
    public long getOpenAshmemSize() {
        return nativeGetOpenAshmemSize(mNativePtr);
    }

    private static String valueTypeToString(int type) {
+3 −3
Original line number Diff line number Diff line
@@ -740,11 +740,11 @@ static jlong android_os_Parcel_getGlobalAllocCount(JNIEnv* env, jclass clazz)
    return Parcel::getGlobalAllocCount();
}

static jlong android_os_Parcel_getBlobAshmemSize(jlong nativePtr)
static jlong android_os_Parcel_getOpenAshmemSize(jlong nativePtr)
{
    Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
    if (parcel != NULL) {
        return parcel->getBlobAshmemSize();
        return parcel->getOpenAshmemSize();
    }
    return 0;
}
@@ -852,7 +852,7 @@ static const JNINativeMethod gParcelMethods[] = {
    {"getGlobalAllocCount",       "()J", (void*)android_os_Parcel_getGlobalAllocCount},

    // @CriticalNative
    {"nativeGetBlobAshmemSize",       "(J)J", (void*)android_os_Parcel_getBlobAshmemSize},
    {"nativeGetOpenAshmemSize",       "(J)J", (void*)android_os_Parcel_getOpenAshmemSize},

    // @CriticalNative
    {"nativeReadCallingWorkSourceUid", "(J)I", (void*)android_os_Parcel_readCallingWorkSourceUid},
+5 −5
Original line number Diff line number Diff line
@@ -409,10 +409,10 @@ public class NotificationTests extends AndroidTestCase {
        sleepIfYouCan(500);

        L("Parceling notifications...");
        // we want to be able to use this test on older OSes that do not have getBlobAshmemSize
        Method getBlobAshmemSize = null;
        // we want to be able to use this test on older OSes that do not have getOpenAshmemSize
        Method getOpenAshmemSize = null;
        try {
            getBlobAshmemSize = Parcel.class.getMethod("getBlobAshmemSize");
            getOpenAshmemSize = Parcel.class.getMethod("getOpenAshmemSize");
        } catch (NoSuchMethodException ex) {
        }
        for (int i=0; i<mNotifications.size(); i++) {
@@ -424,8 +424,8 @@ public class NotificationTests extends AndroidTestCase {
                time = SystemClock.currentThreadTimeMillis() - time;
                L("  %s: write parcel=%dms size=%d ashmem=%s",
                        summarize(n), time, p.dataPosition(),
                        (getBlobAshmemSize != null)
                            ? getBlobAshmemSize.invoke(p)
                        (getOpenAshmemSize != null)
                            ? getOpenAshmemSize.invoke(p)
                            : "???");
                p.setDataPosition(0);
            }