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

Commit 00c53eb6 authored by Jeff Brown's avatar Jeff Brown Committed by Android Git Automerger
Browse files

am f3ae4e17: Merge "Tolerate missing power HAL module." into jb-dev

* commit 'f3ae4e17':
  Tolerate missing power HAL module.
parents 046c8619 f3ae4e17
Loading
Loading
Loading
Loading
+7 −14
Original line number Original line Diff line number Diff line
@@ -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.
@@ -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,