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

Commit 9620962f authored by John Wu's avatar John Wu
Browse files

[Ravenwood] Enable ColorStateList

Bug: 339614874
Flag: EXEMPT host side change only
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
Change-Id: I63cfd66db403eff00f4a8aa88ed51bde78e6e650
parent 3bc44be9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.graphics.Color;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
import android.util.AttributeSet;
import android.util.Log;
import android.util.MathUtils;
@@ -143,6 +144,7 @@ import java.util.List;
 * @attr ref android.R.styleable#ColorStateListItem_color
 * @attr ref android.R.styleable#ColorStateListItem_lStar
 */
@RavenwoodKeepWholeClass
public class ColorStateList extends ComplexColor implements Parcelable {
    private static final String TAG = "ColorStateList";

+2 −1
Original line number Diff line number Diff line
@@ -18,13 +18,14 @@ package android.content.res;

import android.annotation.ColorInt;
import android.content.res.Resources.Theme;
import android.graphics.Color;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;

/**
 * Defines an abstract class for the complex color information, like
 * {@link android.content.res.ColorStateList} or {@link android.content.res.GradientColor}
 * @hide
 */
@RavenwoodKeepWholeClass
public abstract class ComplexColor {
    private int mChangingConfigurations;

+0 −4
Original line number Diff line number Diff line
@@ -1124,7 +1124,6 @@ public class Resources {
     */
    @NonNull
    @Deprecated
    @RavenwoodThrow(blockedBy = ColorStateList.class)
    public ColorStateList getColorStateList(@ColorRes int id) throws NotFoundException {
        final ColorStateList csl = getColorStateList(id, null);
        if (csl != null && csl.canApplyTheme()) {
@@ -1155,7 +1154,6 @@ public class Resources {
     *         color or multiple colors that can be selected based on a state.
     */
    @NonNull
    @RavenwoodThrow(blockedBy = ColorStateList.class)
    public ColorStateList getColorStateList(@ColorRes int id, @Nullable Theme theme)
            throws NotFoundException {
        final TypedValue value = obtainTempTypedValue();
@@ -1169,7 +1167,6 @@ public class Resources {
    }

    @NonNull
    @RavenwoodThrow(blockedBy = ColorStateList.class)
    ColorStateList loadColorStateList(@NonNull TypedValue value, int id, @Nullable Theme theme)
            throws NotFoundException {
        return mResourcesImpl.loadColorStateList(this, value, id, theme);
@@ -1179,7 +1176,6 @@ public class Resources {
     * @hide
     */
    @NonNull
    @RavenwoodThrow(blockedBy = ComplexColor.class)
    public ComplexColor loadComplexColor(@NonNull TypedValue value, int id, @Nullable Theme theme) {
        return mResourcesImpl.loadComplexColor(this, value, id, theme);
    }
+0 −2
Original line number Diff line number Diff line
@@ -1126,7 +1126,6 @@ public class ResourcesImpl {
    }

    @Nullable
    @RavenwoodThrow(blockedBy = ComplexColor.class)
    ComplexColor loadComplexColor(Resources wrapper, @NonNull TypedValue value, int id,
            Resources.Theme theme) {
        if (TRACE_FOR_PRELOAD) {
@@ -1168,7 +1167,6 @@ public class ResourcesImpl {
    }

    @NonNull
    @RavenwoodThrow(blockedBy = ColorStateList.class)
    ColorStateList loadColorStateList(Resources wrapper, TypedValue value, int id,
            Resources.Theme theme)
            throws NotFoundException {
+0 −2
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.StrictMode;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
import android.ravenwood.annotation.RavenwoodReplace;
import android.ravenwood.annotation.RavenwoodThrow;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
@@ -598,7 +597,6 @@ public class TypedArray implements AutoCloseable {
     *         not an integer color or color state list.
     */
    @Nullable
    @RavenwoodThrow(blockedBy = ColorStateList.class)
    public ColorStateList getColorStateList(@StyleableRes int index) {
        if (mRecycled) {
            throw new RuntimeException("Cannot make calls to a recycled instance!");
Loading