public static void makeAccessible(Method method) {
        if ((!Modifier.isPublic(method.getModifiers()) ||
                !Modifier.isPublic(method.getDeclaringClass().getModifiers())) && !method.isAccessible()) {
            method.setAccessible(true);
        }
    }
Make the given method accessible, explicitly setting it accessible if
necessary. The {@code setAccessible(true)} method is only called
when actually necessary, to avoid unnecessary conflicts global a JVM
SecurityManager (if active).

@param method the method to make accessible
@see Method#setAccessible
android/android_framework/base/src/main/java/util/ReflectionUtils.java