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

Commit 99b807fd authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Optimize the flow for checking [Duration Available]" into main am: 5ff37a01 am: aa6a2b08

parents 6fa5d0a1 aa6a2b08
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -716,7 +716,10 @@ public class HdmiCecMessageValidator {
            // Programmed
            int programedInfo = params[offset] & 0x0F;
            if (isValidProgrammedInfo(programedInfo)) {
                if (programedInfo == 0x09 || programedInfo == 0x0B) {
                offset = offset + 1;
                // Duration Available (2 bytes)
                if ((programedInfo == 0x09 || programedInfo == 0x0B)
                        && params.length - offset >= 2) {
                    durationAvailable = true;
                } else {
                    return true;
@@ -726,16 +729,17 @@ public class HdmiCecMessageValidator {
            // Non programmed
            int nonProgramedErrorInfo = params[offset] & 0x0F;
            if (isValidNotProgrammedErrorInfo(nonProgramedErrorInfo)) {
                if (nonProgramedErrorInfo == 0x0E) {
                offset = offset + 1;
                // Duration Available (2 bytes)
                if (nonProgramedErrorInfo == 0x0E && params.length - offset >= 2) {
                    durationAvailable = true;
                } else {
                    return true;
                }
            }
        }
        offset = offset + 1;
        // Duration Available (2 bytes)
        if (durationAvailable && params.length - offset >= 2) {
        if (durationAvailable) {
            return (isValidDurationHours(params[offset]) && isValidMinute(params[offset + 1]));
        }
        return false;