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

Commit fdf4d4fb authored by nift4's avatar nift4 Committed by Daniel Jacob Chittoor
Browse files

PowerManager: don't give invalid hint to AOSP code

While the code did reject it, it's safer and more performant to skip
that codepath when no fallback is available.

Change-Id: I493ac208a6e114fd764a71de23573bec6cc2799d
parent b0078d86
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ static void nativeSetPowerExtMode(JNIEnv* env, jclass /* clazz */, jstring mode,
    }
    if (isSupported) {
        setPowerExtMode(modeStr, enabled);
    } else {
    } else if (fallback >= 0) {
        setPowerMode(static_cast<Mode>(fallback), enabled);
    }
    if (modeStr) {
@@ -316,7 +316,7 @@ static void nativeSetPowerExtBoost(JNIEnv* env, jclass /* clazz */, jstring boos
    }
    if (isSupported) {
        setPowerExtBoost(boostStr, durationMs);
    } else {
    } else if (fallback >= 0) {
        setPowerBoost(static_cast<Boost>(fallback), durationMs);
    }
    if (boostStr) {