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

Commit e848e106 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert incorrect NonNull assertions in ColorStateList loading"

parents de9d31b4 2e41d49d
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -912,7 +912,7 @@ public class ResourcesImpl {
     * first try to load CSL from the cache. If not found, try to get from the constant state.
     * Last, parse the XML and generate the CSL.
     */
    @NonNull
    @Nullable
    private ComplexColor loadComplexColorFromName(Resources wrapper, Resources.Theme theme,
            TypedValue value, int id) {
        final long key = (((long) value.assetCookie) << 32) | value.data;
@@ -932,6 +932,7 @@ public class ResourcesImpl {
            complexColor = loadComplexColorForCookie(wrapper, value, id, theme);
        }

        if (complexColor != null) {
            complexColor.setBaseChangingConfigurations(value.changingConfigurations);

            if (mPreloading) {
@@ -942,6 +943,7 @@ public class ResourcesImpl {
            } else {
                cache.put(key, theme, complexColor.getConstantState());
            }
        }
        return complexColor;
    }

@@ -1044,7 +1046,8 @@ public class ResourcesImpl {
     * We deferred the parser creation to this function b/c we need to differentiate b/t gradient
     * and selector tag.
     *
     * @return a ComplexColor (GradientColor or ColorStateList) based on the XML file content.
     * @return a ComplexColor (GradientColor or ColorStateList) based on the XML file content, or
     *     {@code null} if the XML file is neither.
     */
    @NonNull
    private ComplexColor loadComplexColorForCookie(Resources wrapper, TypedValue value, int id,