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

Commit 810b9cb8 authored by Chaitanya Cheemala (xWF)'s avatar Chaitanya Cheemala (xWF) Committed by Android (Google) Code Review
Browse files

Revert "Add warning message if developer depends on undocumented behavior"

This reverts commit 596db6aa.

Reason for revert: Likely culprit for b/385270677  - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I77a797a4204fff70d471171506360175d6d38b54
parent 596db6aa
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -1586,18 +1586,6 @@ public class Paint {
     * @return         typeface
     */
    public Typeface setTypeface(Typeface typeface) {
        if (Flags.typefaceRedesignReadonly() && typeface != null
                && typeface.isVariationInstance()) {
            Log.w(TAG, "Attempting to set a Typeface on a Paint object that was previously "
                    + "configured with setFontVariationSettings(). This is no longer supported as "
                    + "of Target SDK " + Build.VERSION_CODES.BAKLAVA + ". To apply font"
                    + " variations, call setFontVariationSettings() directly on the Paint object"
                    + " instead.");
        }
        return setTypefaceWithoutWarning(typeface);
    }

    private Typeface setTypefaceWithoutWarning(Typeface typeface) {
        final long typefaceNative = typeface == null ? 0 : typeface.native_instance;
        nSetTypeface(mNativePaint, typefaceNative);
        mTypeface = typeface;
@@ -2195,7 +2183,7 @@ public class Paint {

        if (settings == null || settings.length() == 0) {
            mFontVariationSettings = null;
            setTypefaceWithoutWarning(Typeface.createFromTypefaceWithVariation(mTypeface,
            setTypeface(Typeface.createFromTypefaceWithVariation(mTypeface,
                      Collections.emptyList()));
            return true;
        }
@@ -2214,8 +2202,7 @@ public class Paint {
            return false;
        }
        mFontVariationSettings = settings;
        setTypefaceWithoutWarning(
                Typeface.createFromTypefaceWithVariation(targetTypeface, filteredAxes));
        setTypeface(Typeface.createFromTypefaceWithVariation(targetTypeface, filteredAxes));
        return true;
    }

+0 −11
Original line number Diff line number Diff line
@@ -237,8 +237,6 @@ public class Typeface {

    private @IntRange(from = 0, to = FontStyle.FONT_WEIGHT_MAX) final int mWeight;

    private boolean mIsVariationInstance;

    // Value for weight and italic. Indicates the value is resolved by font metadata.
    // Must be the same as the C++ constant in core/jni/android/graphics/FontFamily.cpp
    /** @hide */
@@ -281,11 +279,6 @@ public class Typeface {
        return mWeight;
    }

    /** @hide */
    public boolean isVariationInstance() {
        return mIsVariationInstance;
    }

    /** Returns the typeface's intrinsic style attributes */
    public @Style int getStyle() {
        return mStyle;
@@ -1287,7 +1280,6 @@ public class Typeface {
        mCleaner = sRegistry.registerNativeAllocation(this, native_instance);
        mStyle = nativeGetStyle(ni);
        mWeight = nativeGetWeight(ni);
        mIsVariationInstance = nativeIsVariationInstance(ni);
        mSystemFontFamilyName = systemFontFamilyName;
        mDerivedFrom = derivedFrom;
    }
@@ -1705,9 +1697,6 @@ public class Typeface {
    @CriticalNative
    private static native int  nativeGetWeight(long nativePtr);

    @CriticalNative
    private static native boolean nativeIsVariationInstance(long nativePtr);

    @CriticalNative
    private static native long nativeGetReleaseFunc();

+0 −6
Original line number Diff line number Diff line
@@ -107,11 +107,6 @@ static jint Typeface_getWeight(CRITICAL_JNI_PARAMS_COMMA jlong faceHandle) {
    return toTypeface(faceHandle)->fStyle.weight();
}

// Critical Native
static jboolean Typeface_isVariationInstance(CRITICAL_JNI_PARAMS_COMMA jlong faceHandle) {
    return toTypeface(faceHandle)->fIsVariationInstance;
}

static jlong Typeface_createFromArray(JNIEnv *env, jobject, jlongArray familyArray,
                                      jlong fallbackPtr, int weight, int italic) {
    ScopedLongArrayRO families(env, familyArray);
@@ -403,7 +398,6 @@ static const JNINativeMethod gTypefaceMethods[] = {
        {"nativeGetReleaseFunc", "()J", (void*)Typeface_getReleaseFunc},
        {"nativeGetStyle", "(J)I", (void*)Typeface_getStyle},
        {"nativeGetWeight", "(J)I", (void*)Typeface_getWeight},
        {"nativeIsVariationInstance", "(J)Z", (void*)Typeface_isVariationInstance},
        {"nativeCreateFromArray", "([JJII)J", (void*)Typeface_createFromArray},
        {"nativeSetDefault", "(J)V", (void*)Typeface_setDefault},
        {"nativeGetSupportedAxes", "(J)[I", (void*)Typeface_getSupportedAxes},