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

Commit f2af6831 authored by Diego Perez's avatar Diego Perez Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Initialize layoutlib variables before using them" into mnc-ub-dev

parents af0f3bda 25913465
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -89,6 +89,12 @@ public class Resources_Delegate {
        // first get the String related to this id in the framework
        Pair<ResourceType, String> resourceInfo = Bridge.resolveResourceId(id);

        // Set the layoutlib callback and context for resources
        if (resources != Resources.mSystem && resources.mLayoutlibCallback == null) {
            resources.mLayoutlibCallback = Resources.mSystem.mLayoutlibCallback;
            resources.mContext = Resources.mSystem.mContext;
        }

        if (resourceInfo != null) {
            platformResFlag_out[0] = true;
            String attributeName = resourceInfo.getSecond();
@@ -98,12 +104,6 @@ public class Resources_Delegate {
                            resourceInfo.getFirst(), attributeName));
        }

        // Set the layoutlib callback and context for resources
        if (resources != Resources.mSystem && resources.mLayoutlibCallback == null) {
            resources.mLayoutlibCallback = Resources.mSystem.mLayoutlibCallback;
            resources.mContext = Resources.mSystem.mContext;
        }

        // didn't find a match in the framework? look in the project.
        if (resources.mLayoutlibCallback != null) {
            resourceInfo = resources.mLayoutlibCallback.resolveResourceId(id);