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

Commit 41f726a9 authored by Amy's avatar Amy Committed by Amy Zhang
Browse files

Do not switch to HOME activity when OneTouchPlay API is called

When OneTouchPlay is called, client side wants the current device to
stream its internal source. But this internal source could be Youtube or
Netflix or pure HOME screen. HDMI framework won't be able to tell the
difference here. We should leave this activity switch responsibility to
the client side.

Test: manual
Bug: 131601411
Change-Id: I55afec05462394fbb004a3037bec59ae0a78018e
(cherry picked from commit c7a701ef9a3cbc07afc75efdf9d2a80f5cb82305)
parent f78861fb
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -73,8 +73,12 @@ public final class HdmiPlaybackClient extends HdmiClient {
    }

    /**
     * Performs the feature 'one touch play' from playback device to turn on display
     * and switch the input.
     * Performs the feature 'one touch play' from playback device to turn on display and claim
     * to be the streaming source.
     *
     * <p>Client side is responsible to send out intent to choose whichever internal
     * source on the current device it would like to switch to. Otherwise the current
     * device will remain on the current input.
     *
     * @param callback {@link OneTouchPlayCallback} object to get informed
     *         of the result
+4 −5
Original line number Diff line number Diff line
@@ -87,14 +87,13 @@ final class OneTouchPlayAction extends HdmiCecFeatureAction {
        HdmiCecLocalDeviceSource source = source();
        source.mService.setAndBroadcastActiveSourceFromOneDeviceType(
                mTargetAddress, getSourcePath());
        // Set local active port to HOME when One Touch Play.
        // Active Port and Current Input are handled by the switch functionality device.
        // When OneTouchPlay is called, client side should be responsible to send out the intent
        // of which internal source, for example YouTube, it would like to switch to.
        // Here we only update the active port and the active source records in the local
        // device as well as claiming Active Source.
        if (source.mService.audioSystem() != null) {
            source = source.mService.audioSystem();
        }
        if (source.getLocalActivePort() != Constants.CEC_SWITCH_HOME) {
            source.switchInputOnReceivingNewActivePath(getSourcePath());
        }
        source.setRoutingPort(Constants.CEC_SWITCH_HOME);
        source.setLocalActivePort(Constants.CEC_SWITCH_HOME);
    }