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

Commit 57642e1d authored by Deepanshu Gupta's avatar Deepanshu Gupta Committed by Android Git Automerger
Browse files

am 8562b08f: Merge "Fix overrides for BridgeResources." into mnc-dev

* commit '8562b08f':
  Fix overrides for BridgeResources.
parents 4d4430bf 8562b08f
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ public final class BridgeResources extends Resources {
    }

    @Override
    public int getColor(int id) throws NotFoundException {
    public int getColor(int id, Theme theme) throws NotFoundException {
        Pair<String, ResourceValue> value = getResourceValue(id, mPlatformResourceFlag);

        if (value != null) {
@@ -192,22 +192,21 @@ public final class BridgeResources extends Resources {
            }
        }

        // id was not found or not resolved. Throw a NotFoundException.
        throwException(id);

        // this is not used since the method above always throws
        return 0;
        // Suppress possible NPE. getColorStateList will never return null, it will instead
        // throw an exception, but intelliJ can't figure that out
        //noinspection ConstantConditions
        return getColorStateList(id, theme).getDefaultColor();
    }

    @Override
    public ColorStateList getColorStateList(int id) throws NotFoundException {
    public ColorStateList getColorStateList(int id, Theme theme) throws NotFoundException {
        Pair<String, ResourceValue> resValue = getResourceValue(id, mPlatformResourceFlag);

        if (resValue != null) {
            ColorStateList stateList = ResourceHelper.getColorStateList(resValue.getSecond(),
                    mContext);
            if (stateList != null) {
                return stateList;
                return stateList.obtainForTheme(theme);
            }
        }