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

Commit 34e01219 authored by Diego Perez's avatar Diego Perez
Browse files

Restore getAccessibleMethod in the preferences inflater

It turns out that although the method was public, the class is package
protected and hence the "Accessible" call

Change-Id: Iec69ad15db4c22d472a941dd335b6cf7789eea09
(cherry picked from commit ff78c344e63c8665ab7b0773b91e473b4fe650ff)
parent c606e64e
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");