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

Commit 0a19d001 authored by Jeff Brown's avatar Jeff Brown
Browse files

Fix a segfault when there is no power module.

This can happen in the emulator.

Bug: 7315152
Change-Id: I4a3f547127419fcd4dc4fc1c6f7ee869706cf12e
parent c0c0c0e6
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ static void nativeReleaseSuspendBlocker(JNIEnv *env, jclass clazz, jstring nameS
}

static void nativeSetInteractive(JNIEnv *env, jclass clazz, jboolean enable) {
    if (gPowerModule) {
        if (enable) {
            ALOGD_IF_SLOW(20, "Excessive delay in setInteractive(true) while turning screen on");
            gPowerModule->setInteractive(gPowerModule, true);
@@ -176,6 +177,7 @@ static void nativeSetInteractive(JNIEnv *env, jclass clazz, jboolean enable) {
            gPowerModule->setInteractive(gPowerModule, false);
        }
    }
}

static void nativeSetAutoSuspend(JNIEnv *env, jclass clazz, jboolean enable) {
    if (enable) {