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

Commit 2e41d49d authored by Chris Craik's avatar Chris Craik
Browse files

Revert incorrect NonNull assertions in ColorStateList loading

Fixes: 73157047
Test: atest CtsContentTestCases:ResourcesTest

Partial revert of ceb26936

Change-Id: I7c1db6f8d2b3451692b018212576960c78250d57
parent bd680ca4
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -911,7 +911,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;
@@ -931,6 +931,7 @@ public class ResourcesImpl {
            complexColor = loadComplexColorForCookie(wrapper, value, id, theme);
        }

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

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

@@ -1043,7 +1045,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,