Loading services/jni/com_android_server_PowerManagerService.cpp +7 −14 Original line number Original line Diff line number Diff line Loading @@ -83,12 +83,10 @@ bool android_server_PowerManagerService_isScreenBright() { } } void android_server_PowerManagerService_userActivity(nsecs_t eventTime, int32_t eventType) { void android_server_PowerManagerService_userActivity(nsecs_t eventTime, int32_t eventType) { if (gPowerModule) { // Tell the power HAL when user activity occurs. // Tell the power HAL when user activity occurs. if (gPowerModule->powerHint) { if (gPowerModule && gPowerModule->powerHint) { gPowerModule->powerHint(gPowerModule, POWER_HINT_INTERACTION, NULL); gPowerModule->powerHint(gPowerModule, POWER_HINT_INTERACTION, NULL); } } } if (gPowerManagerServiceObj) { if (gPowerManagerServiceObj) { // Throttle calls into user activity by event type. // Throttle calls into user activity by event type. Loading Loading @@ -131,16 +129,11 @@ static void nativeInit(JNIEnv* env, jobject obj) { status_t err = hw_get_module(POWER_HARDWARE_MODULE_ID, status_t err = hw_get_module(POWER_HARDWARE_MODULE_ID, (hw_module_t const**)&gPowerModule); (hw_module_t const**)&gPowerModule); if (err) { if (!err) { String8 msg; msg.appendFormat("Couldn't load %s module (%s)", POWER_HARDWARE_MODULE_ID, strerror(-err)); ALOGE("%s", msg.string()); jniThrowRuntimeException(env, msg.string()); return; } gPowerModule->init(gPowerModule); gPowerModule->init(gPowerModule); } else { ALOGE("Couldn't load %s module (%s)", POWER_HARDWARE_MODULE_ID, strerror(-err)); } } } static void nativeSetPowerState(JNIEnv* env, static void nativeSetPowerState(JNIEnv* env, Loading Loading
services/jni/com_android_server_PowerManagerService.cpp +7 −14 Original line number Original line Diff line number Diff line Loading @@ -83,12 +83,10 @@ bool android_server_PowerManagerService_isScreenBright() { } } void android_server_PowerManagerService_userActivity(nsecs_t eventTime, int32_t eventType) { void android_server_PowerManagerService_userActivity(nsecs_t eventTime, int32_t eventType) { if (gPowerModule) { // Tell the power HAL when user activity occurs. // Tell the power HAL when user activity occurs. if (gPowerModule->powerHint) { if (gPowerModule && gPowerModule->powerHint) { gPowerModule->powerHint(gPowerModule, POWER_HINT_INTERACTION, NULL); gPowerModule->powerHint(gPowerModule, POWER_HINT_INTERACTION, NULL); } } } if (gPowerManagerServiceObj) { if (gPowerManagerServiceObj) { // Throttle calls into user activity by event type. // Throttle calls into user activity by event type. Loading Loading @@ -131,16 +129,11 @@ static void nativeInit(JNIEnv* env, jobject obj) { status_t err = hw_get_module(POWER_HARDWARE_MODULE_ID, status_t err = hw_get_module(POWER_HARDWARE_MODULE_ID, (hw_module_t const**)&gPowerModule); (hw_module_t const**)&gPowerModule); if (err) { if (!err) { String8 msg; msg.appendFormat("Couldn't load %s module (%s)", POWER_HARDWARE_MODULE_ID, strerror(-err)); ALOGE("%s", msg.string()); jniThrowRuntimeException(env, msg.string()); return; } gPowerModule->init(gPowerModule); gPowerModule->init(gPowerModule); } else { ALOGE("Couldn't load %s module (%s)", POWER_HARDWARE_MODULE_ID, strerror(-err)); } } } static void nativeSetPowerState(JNIEnv* env, static void nativeSetPowerState(JNIEnv* env, Loading