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

Commit e2e8ba90 authored by Raphael's avatar Raphael
Browse files

Layoutlib_Create: Fix order of class adapters.

The Transform adapter was running last, instead of
running on the output of the Delegate adapter.

Change-Id: I2cd777add7b0972c6bb197aaac6693d39dd5a103
parent 280372e2
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -313,6 +313,11 @@ public class AsmGenerator {
            rv = new RenameClassAdapter(cw, className, newName);
        }

        ClassVisitor cv = new TransformClassAdapter(mLog, mStubMethods,
                mDeleteReturns.get(className),
                newName, rv,
                stubNativesOnly, stubNativesOnly || hasNativeMethods);

        Set<String> delegateMethods = mDelegateMethods.get(className);
        if (delegateMethods != null && !delegateMethods.isEmpty()) {
            // If delegateMethods only contains one entry ALL_NATIVES and the class is
@@ -320,14 +325,10 @@ public class AsmGenerator {
            if (hasNativeMethods ||
                    !(delegateMethods.size() == 1 &&
                            delegateMethods.contains(DelegateClassAdapter.ALL_NATIVES))) {
                rv = new DelegateClassAdapter(mLog, rv, className, delegateMethods);
                cv = new DelegateClassAdapter(mLog, cv, className, delegateMethods);
            }
        }

        TransformClassAdapter cv = new TransformClassAdapter(mLog, mStubMethods,
                mDeleteReturns.get(className),
                newName, rv,
                stubNativesOnly, stubNativesOnly || hasNativeMethods);
        cr.accept(cv, 0 /* flags */);
        return cw.toByteArray();
    }