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

Commit f434a251 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Register native allocation for Font" into sc-dev am: 7a063e67

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I61c80771bce88f2d8445eefba06f693a33c1505b
parents 6bac4920 7a063e67
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -63,6 +63,10 @@ public final class Font {
            NativeAllocationRegistry.createMalloced(
                    ByteBuffer.class.getClassLoader(), nGetReleaseNativeFont());

    private static final NativeAllocationRegistry FONT_REGISTRY =
            NativeAllocationRegistry.createMalloced(Font.class.getClassLoader(),
                    nGetReleaseNativeFont());

    private static final Object SOURCE_ID_LOCK = new Object();
    @GuardedBy("SOURCE_ID_LOCK")
    private static final LongSparseLongArray FONT_SOURCE_ID_MAP =
@@ -526,11 +530,14 @@ public final class Font {
     * Use Builder instead
     *
     * Caller must increment underlying minikin::Font ref count.
     * This class takes the ownership of the passing native objects.
     *
     * @hide
     */
    public Font(long nativePtr) {
        mNativePtr = nativePtr;

        FONT_REGISTRY.registerNativeAllocation(this, mNativePtr);
    }

    /**