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

Commit f0a9d58f authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Fix AOD issues with virtual device power states.

When AOD is enabled, all power groups trigger display POLICY_DOZE
instead of POLICY_OFF.

1. Do not doze when putting the VD to sleep, going directly to OFF

2. Do not doze when the screen timeout is expired for power groups
that belong to a virtual device.

Fix: 416220040
Bug: 415335388
Test: manual and CTS
Flag: android.companion.virtualdevice.flags.virtual_power_group_sleep_no_doze

Change-Id: I83f9c5948f1c2828d31a195a88465a2d42634698
parent db990e60
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -129,6 +129,16 @@ flag {
    }
}

flag {
    name: "virtual_power_group_sleep_no_doze"
    namespace: "virtual_devices"
    description: "Sleep non-default power groups directly, skipping doze"
    bug: "416220040"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "vdm_settings"
    namespace: "virtual_devices"
+5 −0
Original line number Diff line number Diff line
@@ -2256,6 +2256,11 @@ public final class PowerManagerService extends SystemService
    @GuardedBy("mLock")
    private boolean dozePowerGroupLocked(final PowerGroup powerGroup, long eventTime,
            @GoToSleepReason int reason, int uid) {
        if (powerGroup.getGroupId() != Display.DEFAULT_DISPLAY_GROUP
                && android.companion.virtualdevice.flags.Flags.virtualPowerGroupSleepNoDoze()) {
            return sleepPowerGroupLocked(powerGroup, eventTime, reason, uid);
        }

        if (DEBUG_SPEW) {
            Slog.d(TAG, "dozePowerGroup: eventTime=" + eventTime
                    + ", groupId=" + powerGroup.getGroupId()