int register_asusdec_KeyHandler(JNIEnv* env) { return jniRegisterNativeMethods(env, "com/cyanogenmod/asusdec/KeyHandler", sMethods, NELEM(sMethods)); }
int register_com_android_nfc_NativeLlcpServiceSocket(JNIEnv *e) { return jniRegisterNativeMethods(e, "com/android/nfc/dhimpl/NativeLlcpServiceSocket", gMethods, NELEM(gMethods)); }
/******************************************************************************* ** ** Function: register_com_android_nfc_NativeLlcpConnectionlessSocket ** ** Description: Regisgter JNI functions with Java Virtual Machine. ** e: Environment of JVM. ** ** Returns: Status of registration. ** *******************************************************************************/ int register_com_android_nfc_NativeLlcpConnectionlessSocket (JNIEnv *e) { return jniRegisterNativeMethods (e, gNativeLlcpConnectionlessSocketClassName, gMethods, NELEM(gMethods)); }
int register_com_android_nfc_NativeP2pDevice(JNIEnv *e) { return jniRegisterNativeMethods(e, "com/android/nfc/dhimpl/NativeP2pDevice", gMethods, NELEM(gMethods)); }
int register_android_server_ScanService(JNIEnv *env) { return jniRegisterNativeMethods(env, "com/android/server/ScanService", method_table, NELEM(method_table)); }
int register_com_android_nfc_NativeNfcSecureElement(JNIEnv *e) { return jniRegisterNativeMethods(e, "com/android/nfc/NativeNfcSecureElement", gMethods, NELEM(gMethods)); }
void register_libcore_io_Windows(JNIEnv* env) { #if defined(__MINGW32__) || defined(__MINGW64__) jniRegisterNativeMethods(env, "libcore/io/Windows", gMethods, NELEM(gMethods)); #endif }
void register_java_lang_Math(JNIEnv* env) { jniRegisterNativeMethods(env, "java/lang/Math", gMethods, NELEM(gMethods)); }
int register_com_android_internal_os_RuntimeInit(JNIEnv* env) { return jniRegisterNativeMethods(env, "com/android/internal/os/RuntimeInit", gMethods, NELEM(gMethods)); }
void register_java_lang_ProcessEnvironment(JNIEnv* env) { jniRegisterNativeMethods(env, "java/lang/ProcessEnvironment", gMethods, NELEM(gMethods)); }
void register_libcore_io_OsConstants(JNIEnv* env) { jniRegisterNativeMethods(env, "libcore/io/OsConstants", gMethods, NELEM(gMethods)); }
int register_android_media_FFMpegPlayerAndroid(JNIEnv *env) { ffmpeg_audio.initzialized = false; ffmpeg_video.initzialized = false; return jniRegisterNativeMethods(env, "com/media/ffmpeg/android/FFMpegPlayerAndroid", methods, sizeof(methods) / sizeof(methods[0])); }
int register_mediaplayer(JNIEnv* env) { return jniRegisterNativeMethods(env, g_ProxyJavaClass, g_MediaPlayerMethods, NELEM(g_MediaPlayerMethods)); }
int register_java_util_zip_Inflater(JNIEnv* env) { return jniRegisterNativeMethods(env, "java/util/zip/Inflater", gMethods, NELEM(gMethods)); }
void register_java_math_NativeBN(JNIEnv* env) { jniRegisterNativeMethods(env, "java/math/NativeBN", gMethods, NELEM(gMethods)); }
/* * Register native methods using JNI. */ /*static*/ int AndroidRuntime::registerNativeMethods(JNIEnv* env, const char* className, const JNINativeMethod* gMethods, int numMethods) { return jniRegisterNativeMethods(env, className, gMethods, numMethods); }
/******************************************************************************* ** ** Function: register_com_android_nfc_NativeNfcAla ** ** Description: Regisgter JNI functions with Java Virtual Machine. ** e: Environment of JVM. ** ** Returns: Status of registration. ** *******************************************************************************/ int register_com_android_nfc_NativeNfcAla(JNIEnv *e) { return jniRegisterNativeMethods(e, gNativeNfcAlaClassName, gMethods, NELEM(gMethods)); }
/*Register several native methods for one class*/ int registerNativeMethods(JNIEnv *env,const char *className, JNINativeMethod *gMethods,int numMethods){ return jniRegisterNativeMethods(env, className, gMethods, numMethods); }
int register_org_khronos_OpenVX_Context(JNIEnv *env) { PrintJNITable(LOG_TAG, ContextClass, method_table, NELEM(method_table)); return jniRegisterNativeMethods(env, ContextClass, method_table, NELEM(method_table)); }
int register_android_server_BatteryService(JNIEnv* env) { char path[PATH_MAX]; struct dirent* entry; DIR* dir = opendir(POWER_SUPPLY_PATH); if (dir == NULL) { ALOGE("Could not open %s\n", POWER_SUPPLY_PATH); return -1; } while ((entry = readdir(dir))) { const char* name = entry->d_name; // ignore "." and ".." if (name[0] == '.' && (name[1] == 0 || (name[1] == '.' && name[2] == 0))) { continue; } char buf[20]; // Look for "type" file in each subdirectory snprintf(path, sizeof(path), "%s/%s/type", POWER_SUPPLY_PATH, name); int length = readFromFile(path, buf, sizeof(buf)); if (length > 0) { if (buf[length - 1] == '\n') buf[length - 1] = 0; if (strcmp(buf, "Mains") == 0) { snprintf(path, sizeof(path), "%s/%s/online", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.acOnlinePath = strdup(path); } else if (strcmp(buf, "USB") == 0) { snprintf(path, sizeof(path), "%s/%s/online", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.usbOnlinePath = strdup(path); } else if (strcmp(buf, "Battery") == 0) { snprintf(path, sizeof(path), "%s/%s/status", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.batteryStatusPath = strdup(path); snprintf(path, sizeof(path), "%s/%s/health", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.batteryHealthPath = strdup(path); snprintf(path, sizeof(path), "%s/%s/present", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.batteryPresentPath = strdup(path); // 1% battery mod snprintf(path, sizeof(path), "%s/%s/charge_counter", POWER_SUPPLY_PATH, name); //snprintf(path, sizeof(path), "%s/%s/capacity", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.batteryCapacityPath = strdup(path); snprintf(path, sizeof(path), "%s/%s/voltage_now", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) { gPaths.batteryVoltagePath = strdup(path); // voltage_now is in microvolts, not millivolts gVoltageDivisor = 1000; } else { snprintf(path, sizeof(path), "%s/%s/batt_vol", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.batteryVoltagePath = strdup(path); } snprintf(path, sizeof(path), "%s/%s/temp", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) { gPaths.batteryTemperaturePath = strdup(path); } else { snprintf(path, sizeof(path), "%s/%s/batt_temp", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.batteryTemperaturePath = strdup(path); } snprintf(path, sizeof(path), "%s/%s/technology", POWER_SUPPLY_PATH, name); if (access(path, R_OK) == 0) gPaths.batteryTechnologyPath = strdup(path); } } } closedir(dir); if (!gPaths.acOnlinePath) ALOGE("acOnlinePath not found"); if (!gPaths.usbOnlinePath) ALOGE("usbOnlinePath not found"); if (!gPaths.batteryStatusPath) ALOGE("batteryStatusPath not found"); if (!gPaths.batteryHealthPath) ALOGE("batteryHealthPath not found"); if (!gPaths.batteryPresentPath) ALOGE("batteryPresentPath not found"); if (!gPaths.batteryCapacityPath) ALOGE("batteryCapacityPath not found"); if (!gPaths.batteryVoltagePath) ALOGE("batteryVoltagePath not found"); if (!gPaths.batteryTemperaturePath) ALOGE("batteryTemperaturePath not found"); if (!gPaths.batteryTechnologyPath) ALOGE("batteryTechnologyPath not found"); jclass clazz = env->FindClass("com/android/server/BatteryService"); if (clazz == NULL) { ALOGE("Can't find com/android/server/BatteryService"); return -1; } gFieldIds.mAcOnline = env->GetFieldID(clazz, "mAcOnline", "Z"); gFieldIds.mUsbOnline = env->GetFieldID(clazz, "mUsbOnline", "Z"); gFieldIds.mBatteryStatus = env->GetFieldID(clazz, "mBatteryStatus", "I"); gFieldIds.mBatteryHealth = env->GetFieldID(clazz, "mBatteryHealth", "I"); gFieldIds.mBatteryPresent = env->GetFieldID(clazz, "mBatteryPresent", "Z"); gFieldIds.mBatteryLevel = env->GetFieldID(clazz, "mBatteryLevel", "I"); gFieldIds.mBatteryTechnology = env->GetFieldID(clazz, "mBatteryTechnology", "Ljava/lang/String;"); gFieldIds.mBatteryVoltage = env->GetFieldID(clazz, "mBatteryVoltage", "I"); gFieldIds.mBatteryTemperature = env->GetFieldID(clazz, "mBatteryTemperature", "I"); LOG_FATAL_IF(gFieldIds.mAcOnline == NULL, "Unable to find BatteryService.AC_ONLINE_PATH"); LOG_FATAL_IF(gFieldIds.mUsbOnline == NULL, "Unable to find BatteryService.USB_ONLINE_PATH"); LOG_FATAL_IF(gFieldIds.mBatteryStatus == NULL, "Unable to find BatteryService.BATTERY_STATUS_PATH"); LOG_FATAL_IF(gFieldIds.mBatteryHealth == NULL, "Unable to find BatteryService.BATTERY_HEALTH_PATH"); LOG_FATAL_IF(gFieldIds.mBatteryPresent == NULL, "Unable to find BatteryService.BATTERY_PRESENT_PATH"); LOG_FATAL_IF(gFieldIds.mBatteryLevel == NULL, "Unable to find BatteryService.BATTERY_CAPACITY_PATH"); LOG_FATAL_IF(gFieldIds.mBatteryVoltage == NULL, "Unable to find BatteryService.BATTERY_VOLTAGE_PATH"); LOG_FATAL_IF(gFieldIds.mBatteryTemperature == NULL, "Unable to find BatteryService.BATTERY_TEMPERATURE_PATH"); LOG_FATAL_IF(gFieldIds.mBatteryTechnology == NULL, "Unable to find BatteryService.BATTERY_TECHNOLOGY_PATH"); clazz = env->FindClass("android/os/BatteryManager"); if (clazz == NULL) { ALOGE("Can't find android/os/BatteryManager"); return -1; } gConstants.statusUnknown = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_STATUS_UNKNOWN", "I")); gConstants.statusCharging = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_STATUS_CHARGING", "I")); gConstants.statusDischarging = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_STATUS_DISCHARGING", "I")); gConstants.statusNotCharging = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_STATUS_NOT_CHARGING", "I")); gConstants.statusFull = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_STATUS_FULL", "I")); gConstants.healthUnknown = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_HEALTH_UNKNOWN", "I")); gConstants.healthGood = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_HEALTH_GOOD", "I")); gConstants.healthOverheat = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_HEALTH_OVERHEAT", "I")); gConstants.healthDead = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_HEALTH_DEAD", "I")); gConstants.healthOverVoltage = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_HEALTH_OVER_VOLTAGE", "I")); gConstants.healthUnspecifiedFailure = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_HEALTH_UNSPECIFIED_FAILURE", "I")); gConstants.healthCold = env->GetStaticIntField(clazz, env->GetStaticFieldID(clazz, "BATTERY_HEALTH_COLD", "I")); return jniRegisterNativeMethods(env, "com/android/server/BatteryService", sMethods, NELEM(sMethods)); }
int register_org_openssl_NativeBN(JNIEnv* env) { return jniRegisterNativeMethods(env, "org/openssl/NativeBN", METHODS, NELEM(METHODS)); }
/******************************************************************************* ** ** Function: register_com_android_nfc_NativeP2pDevice ** ** Description: Regisgter JNI functions with Java Virtual Machine. ** e: Environment of JVM. ** ** Returns: Status of registration. ** *******************************************************************************/ int register_com_android_nfc_NativeP2pDevice (JNIEnv* e) { return jniRegisterNativeMethods (e, gNativeP2pDeviceClassName, gMethods, NELEM(gMethods)); }
int register_org_apache_harmony_luni_util_NumberConvert(JNIEnv *env) { return jniRegisterNativeMethods(env, "org/apache/harmony/luni/util/NumberConverter", gMethods, NELEM(gMethods)); }
void register_libcore_icu_TimeZoneNames(JNIEnv* env) { jniRegisterNativeMethods(env, "libcore/icu/TimeZoneNames", gMethods, NELEM(gMethods)); }
int register_org_khronos_OpenVX_Target(JNIEnv *env) { PrintJNITable(LOG_TAG, ParameterClass, method_table, NELEM(method_table)); return jniRegisterNativeMethods(env, TargetClass, method_table, NELEM(method_table)); }
int register_java_lang_RealToString(JNIEnv* env) { return jniRegisterNativeMethods(env, "java/lang/RealToString", gMethods, NELEM(gMethods)); }
int register_java_lang_ProcessManager(JNIEnv* env) { return jniRegisterNativeMethods(env, "java/lang/ProcessManager", methods, NELEM(methods)); }
int register_android_server_AlarmManagerService(JNIEnv* env) { return jniRegisterNativeMethods(env, "com/android/server/AlarmManagerService", sMethods, NELEM(sMethods)); }
int register_com_android_bluetooth_avrcp_controller(JNIEnv* env) { return jniRegisterNativeMethods(env, "com/android/bluetooth/avrcp/AvrcpControllerService", sMethods, NELEM(sMethods)); }
int register_java_io_FileDescriptor(JNIEnv* env) { return jniRegisterNativeMethods(env, "java/io/FileDescriptor", gMethods, NELEM(gMethods)); }