diff --git a/graphics/java/android/graphics/text/MeasuredText.java b/graphics/java/android/graphics/text/MeasuredText.java index 3efe655b25654..6f786517ba125 100644 --- a/graphics/java/android/graphics/text/MeasuredText.java +++ b/graphics/java/android/graphics/text/MeasuredText.java @@ -48,9 +48,6 @@ import libcore.util.NativeAllocationRegistry; *

*/ public class MeasuredText { - private static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry( - MeasuredText.class.getClassLoader(), nGetReleaseFunc(), 1024); - private long mNativePtr; private @NonNull char[] mChars; @@ -166,6 +163,9 @@ public class MeasuredText { * Note: The appendStyle and appendReplacementRun should be called to cover the text length. */ public static class Builder { + private static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry( + MeasuredText.class.getClassLoader(), nGetReleaseFunc(), 1024); + private long mNativePtr; private final @NonNull char[] mText;