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

Commit 58500f43 authored by Jinsuk Kim's avatar Jinsuk Kim
Browse files

CEC: Make deviceSelect to active device a no-op

Changing input to already the active source should return
immediately without initiating routing control. This is also required
for processing the incoming <Active Source>

Also set the flag in intent for input change to start a new
activity from a service. The service fails to launch an activity
without it.

Bug: 15570939
Change-Id: I9b20b31137dfa4dc847bc43cc7fd35e669d0dec7
parent 976e8bd2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -165,6 +165,11 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    @ServiceThreadOnly
    void deviceSelect(int targetAddress, IHdmiControlCallback callback) {
        assertRunOnServiceThread();
        ActiveSource active = getActiveSource();
        if (active.isValid() && targetAddress == active.logicalAddress) {
            invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
            return;
        }
        if (targetAddress == Constants.ADDR_INTERNAL) {
            handleSelectInternalSource();
            // Switching to internal source is always successful even when CEC control is disabled.
+1 −0
Original line number Diff line number Diff line
@@ -930,6 +930,7 @@ class TvInputHardwareManager implements TvInputHal.Callback {
            if (inputId != null) {
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(TvContract.buildChannelUriForPassthroughTvInput(inputId));
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                mContext.startActivity(intent);
            } else {
                Slog.w(TAG, "onChanged: InputId cannot be found for :" + device);