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

Commit 9191d7c9 authored by Amy Zhang's avatar Amy Zhang Committed by Android (Google) Code Review
Browse files

Merge "Do not switch to HOME activity when OneTouchPlay API is called"

parents 724c75b6 41f726a9
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);
    }