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

Commit 80cd819a authored by Jeff Brown's avatar Jeff Brown
Browse files

Use more reasonable warning thresholds for power on/off.

To encourage vendors to make power on/off as efficient
and responsive as possible, we log some warnings whenever it
is too slow.  The previous thresholds were a little
unreasonable mainly because we wanted to understand
how long the process tends to take even when it's fast.

Raise the warning limit while still being aggressive about
timings.  Ideally we want the screen to turn on/off within
no more than a few frames.

Bug: 7167820
Change-Id: Id28dbf8c91cefa7ae7544b72887104af7aabccff
parent 5e21bf93
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -174,32 +174,32 @@ static void nativeSetScreenState(JNIEnv *env, jclass clazz, jboolean on) {
    sp<ISurfaceComposer> s(ComposerService::getComposerService());
    if (on) {
        {
            ALOGD_IF_SLOW(50, "Excessive delay in autosuspend_disable() while turning screen on");
            ALOGD_IF_SLOW(100, "Excessive delay in autosuspend_disable() while turning screen on");
            autosuspend_disable();
        }

        if (gPowerModule) {
            ALOGD_IF_SLOW(10, "Excessive delay in setInteractive(true) while turning screen on");
            ALOGD_IF_SLOW(20, "Excessive delay in setInteractive(true) while turning screen on");
            gPowerModule->setInteractive(gPowerModule, true);
        }

        {
            ALOGD_IF_SLOW(20, "Excessive delay in unblank() while turning screen on");
            ALOGD_IF_SLOW(100, "Excessive delay in unblank() while turning screen on");
            s->unblank();
        }
    } else {
        {
            ALOGD_IF_SLOW(20, "Excessive delay in blank() while turning screen off");
            ALOGD_IF_SLOW(100, "Excessive delay in blank() while turning screen off");
            s->blank();
        }

        if (gPowerModule) {
            ALOGD_IF_SLOW(10, "Excessive delay in setInteractive(false) while turning screen off");
            ALOGD_IF_SLOW(20, "Excessive delay in setInteractive(false) while turning screen off");
            gPowerModule->setInteractive(gPowerModule, false);
        }

        {
            ALOGD_IF_SLOW(50, "Excessive delay in autosuspend_enable() while turning screen off");
            ALOGD_IF_SLOW(100, "Excessive delay in autosuspend_enable() while turning screen off");
            autosuspend_enable();
        }
    }