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

Commit fd434cbc authored by Nathalie Le Clair's avatar Nathalie Le Clair
Browse files

Only send <Standby> to TV on sleep when active source

Test: make, flash, let device go to sleep due to keycode_power and
energy saver mode, verify that <Standby> is only sent when mIsActiveSource is true.

Bug: 155228844
Change-Id: Ie62d60e8c4fa573aac6c08a4c1093d5f1a52d7f3
parent b0033693
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -165,10 +165,11 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource {
            mService.sendCecCommand(HdmiCecMessageBuilder.buildInactiveSource(
                    mAddress, mService.getPhysicalAddress()));
        }
        boolean wasActiveSource = mIsActiveSource;
        // Invalidate the internal active source record when goes to standby
        // This set will also update mIsActiveSource
        mService.setActiveSource(Constants.ADDR_INVALID, Constants.INVALID_PHYSICAL_ADDRESS);
        if (initiatedByCec || !mAutoTvOff) {
        if (initiatedByCec || !mAutoTvOff || !wasActiveSource) {
            return;
        }
        switch (standbyAction) {