Search in sources :

Example 1 with NoSuchFieldException

use of java.lang.NoSuchFieldException in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DimmableIZatIconPreference method load.

private static void load(Context context) {
    if (mLoader == null) {
        try {
            if (mXtProxyClz == null || mNotifierClz == null) {
                mLoader = new DexClassLoader("/system/framework/izat.xt.srv.jar", context.getFilesDir().getAbsolutePath(), null, ClassLoader.getSystemClassLoader());
                mXtProxyClz = Class.forName("com.qti.izat.XTProxy", true, mLoader);
                mNotifierClz = Class.forName("com.qti.izat.XTProxy$Notifier", true, mLoader);
                mIzatPackage = (String) mXtProxyClz.getField("IZAT_XT_PACKAGE").get(null);
                mGetXtProxyMethod = mXtProxyClz.getMethod("getXTProxy", Context.class, mNotifierClz);
                mGetConsentMethod = mXtProxyClz.getMethod("getUserConsent");
                mShowIzatMethod = mXtProxyClz.getMethod("showIzat", Context.class, String.class);
            }
        } catch (NoSuchMethodException | NullPointerException | SecurityException | NoSuchFieldException | LinkageError | IllegalAccessException | ClassNotFoundException e) {
            mXtProxyClz = null;
            mNotifierClz = null;
            mIzatPackage = null;
            mGetXtProxyMethod = null;
            mGetConsentMethod = null;
            mShowIzatMethod = null;
            e.printStackTrace();
        }
    }
}
Also used : Context(android.content.Context) LinkageError(java.lang.LinkageError) NullPointerException(java.lang.NullPointerException) DexClassLoader(dalvik.system.DexClassLoader) SecurityException(java.lang.SecurityException) NoSuchFieldException(java.lang.NoSuchFieldException) ClassNotFoundException(java.lang.ClassNotFoundException) NoSuchMethodException(java.lang.NoSuchMethodException) IllegalAccessException(java.lang.IllegalAccessException)

Example 2 with NoSuchFieldException

use of java.lang.NoSuchFieldException in project openj9 by eclipse.

the class EnumPointer method sizeOfBaseType.

@Override
protected long sizeOfBaseType() {
    if (enumSize == -1) {
        try {
            Field field = enumClazz.getField("SIZEOF");
            enumSize = field.getLong(null);
        } catch (NoSuchFieldException e) {
            throw new IllegalArgumentException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new IllegalArgumentException(e.getMessage());
        }
    }
    return enumSize;
}
Also used : Field(java.lang.reflect.Field) NoSuchFieldException(java.lang.NoSuchFieldException)

Aggregations

NoSuchFieldException (java.lang.NoSuchFieldException)2 Context (android.content.Context)1 DexClassLoader (dalvik.system.DexClassLoader)1 ClassNotFoundException (java.lang.ClassNotFoundException)1 IllegalAccessException (java.lang.IllegalAccessException)1 LinkageError (java.lang.LinkageError)1 NoSuchMethodException (java.lang.NoSuchMethodException)1 NullPointerException (java.lang.NullPointerException)1 SecurityException (java.lang.SecurityException)1 Field (java.lang.reflect.Field)1