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

Commit 9d0577ec authored by Xavier Ducrohet's avatar Xavier Ducrohet
Browse files

LayoutLib: properly configure ApplicationInfo with targetSdkVersion.

Change-Id: I1bfef890206552843d1a7a8d0564741f2a37494f
parent f6864bec
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ public final class BridgeContext extends Activity {
    private final Object mProjectKey;
    private final DisplayMetrics mMetrics;
    private final RenderResources mRenderResources;
    private final ApplicationInfo mApplicationInfo;

    private final Map<Object, Map<String, String>> mDefaultPropMaps =
        new IdentityHashMap<Object, Map<String,String>>();
@@ -112,10 +113,12 @@ public final class BridgeContext extends Activity {
     * value is the resource value.
     * @param styleInheritanceMap
     * @param projectCallback
     * @param targetSdkVersion the targetSdkVersion of the application.
     */
    public BridgeContext(Object projectKey, DisplayMetrics metrics,
            RenderResources renderResources,
            IProjectCallback projectCallback) {
            IProjectCallback projectCallback,
            int targetSdkVersion) {
        mProjectKey = projectKey;
        mMetrics = metrics;
        mProjectCallback = projectCallback;
@@ -124,6 +127,9 @@ public final class BridgeContext extends Activity {

        mFragments.mCurState = Fragment.CREATED;
        mFragments.mActivity = this;

        mApplicationInfo = new ApplicationInfo();
        mApplicationInfo.targetSdkVersion = targetSdkVersion;
    }

    /**
@@ -836,7 +842,7 @@ public final class BridgeContext extends Activity {

    @Override
    public ApplicationInfo getApplicationInfo() {
        return new ApplicationInfo();
        return mApplicationInfo;
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider {

        // build the context
        mContext = new BridgeContext(mParams.getProjectKey(), metrics, resources,
                mParams.getProjectCallback());
                mParams.getProjectCallback(), mParams.getTargetSdkVersion());


        setUp();