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

Commit e1e63c7c authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Jungshik Jang
Browse files

DO NOT MERGE: Dispatch incoming CEC messages to feature actions

This CL dispatches incoming CEC messages to feature actions that
the service manages.

Change-Id: I9221d6a25648846327d00fe5404aaf1e8ec786ce
parent d42a7a32
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -290,8 +290,7 @@ public final class HdmiControlService extends SystemService {
            // TODO: Add remaining system information query such as
            // <Give Device Power Status> and <Request Active Source> handler.
            default:
                Slog.w(TAG, "Unsupported cec command:" + message.toString());
                return false;
                return dispatchMessageToAction(message);
        }
    }

@@ -394,6 +393,16 @@ public final class HdmiControlService extends SystemService {
        }
    }

    private boolean dispatchMessageToAction(HdmiCecMessage message) {
        for (FeatureAction action : mActions) {
            if (action.processCommand(message)) {
                return true;
            }
        }
        Slog.w(TAG, "Unsupported cec command:" + message);
        return false;
    }

    // Record class that monitors the event of the caller of being killed. Used to clean up
    // the listener list and record list accordingly.
    private final class HotplugEventListenerRecord implements IBinder.DeathRecipient {