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

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

Merge "Restore getAccessibleMethod in the preferences inflater"

parents d61b1116 34e01219
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;

import static com.android.layoutlib.bridge.util.ReflectionUtils.getAccessibleMethod;
import static com.android.layoutlib.bridge.util.ReflectionUtils.getClassInstance;
import static com.android.layoutlib.bridge.util.ReflectionUtils.getMethod;
import static com.android.layoutlib.bridge.util.ReflectionUtils.invoke;
@@ -93,9 +94,10 @@ public class SupportPreferencesUtil {
        Object preferenceInflater = instantiateClass(callback, PREFERENCE_INFLATER,
          new Class[]{Context.class, preferenceManager.getClass()},
          new Object[]{context, preferenceManager});
        Object inflatedPreference = invoke(
          getMethod(preferenceInflater.getClass(), "inflate", XmlPullParser.class,
            preferenceGroupClass), preferenceInflater, parser, null);
        Object inflatedPreference =
                invoke(getAccessibleMethod(preferenceInflater.getClass(), "inflate",
                        XmlPullParser.class, preferenceGroupClass), preferenceInflater, parser,
                        null);

        if (inflatedPreference == null) {
            throw new ReflectionException("inflate method returned null");