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

Commit 02f31151 authored by Amy's avatar Amy Committed by shubang
Browse files

Add property to never claim playback logic address

This supports handling OneTouchPlay without player logical address

ag/4891910

Test: local test.
Change-Id: I4af65fb251b240c2487f6b4b336cb70fc52837a0
parent 1bafe67c
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -283,6 +283,15 @@ final class Constants {
    static final String PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE =
    static final String PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE =
            "persist.sys.hdmi.property_system_audio_mode_muting_enable";
            "persist.sys.hdmi.property_system_audio_mode_muting_enable";


    /**
     * When set to true the HdmiControlService will never request a Logical Address for the
     * playback device type. Default is false.
     *
     * <p> This is useful when HDMI CEC multiple device types is not supported by the cec driver
     */
    static final String PROPERTY_HDMI_CEC_NEVER_CLAIM_PLAYBACK_LOGICAL_ADDRESS =
            "ro.hdmi.property_hdmi_cec_never_claim_playback_logical_address";

    // Set to false to allow playback device to go to suspend mode even
    // Set to false to allow playback device to go to suspend mode even
    // when it's an active source. True by default.
    // when it's an active source. True by default.
    static final String PROPERTY_KEEP_AWAKE = "persist.sys.hdmi.keep_awake";
    static final String PROPERTY_KEEP_AWAKE = "persist.sys.hdmi.keep_awake";
+12 −0
Original line number Original line Diff line number Diff line
@@ -140,6 +140,10 @@ public class HdmiControlService extends SystemService {
    static final int STANDBY_SCREEN_OFF = 0;
    static final int STANDBY_SCREEN_OFF = 0;
    static final int STANDBY_SHUTDOWN = 1;
    static final int STANDBY_SHUTDOWN = 1;


    private static final boolean isHdmiCecNeverClaimPlaybackLogicAddr =
            SystemProperties.getBoolean(
                    Constants.PROPERTY_HDMI_CEC_NEVER_CLAIM_PLAYBACK_LOGICAL_ADDRESS, false);

    /**
    /**
     * Interface to report send result.
     * Interface to report send result.
     */
     */
@@ -639,6 +643,10 @@ public class HdmiControlService extends SystemService {
        // A container for [Device type, Local device info].
        // A container for [Device type, Local device info].
        ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>();
        ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>();
        for (int type : mLocalDevices) {
        for (int type : mLocalDevices) {
            if (type == HdmiDeviceInfo.DEVICE_PLAYBACK
                    && isHdmiCecNeverClaimPlaybackLogicAddr) {
                continue;
            }
            HdmiCecLocalDevice localDevice = mCecController.getLocalDevice(type);
            HdmiCecLocalDevice localDevice = mCecController.getLocalDevice(type);
            if (localDevice == null) {
            if (localDevice == null) {
                localDevice = HdmiCecLocalDevice.create(this, type);
                localDevice = HdmiCecLocalDevice.create(this, type);
@@ -1003,6 +1011,10 @@ public class HdmiControlService extends SystemService {
        if (connected && !isTvDevice()) {
        if (connected && !isTvDevice()) {
            ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>();
            ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>();
            for (int type : mLocalDevices) {
            for (int type : mLocalDevices) {
                if (type == HdmiDeviceInfo.DEVICE_PLAYBACK
                        && isHdmiCecNeverClaimPlaybackLogicAddr) {
                    continue;
                }
                HdmiCecLocalDevice localDevice = mCecController.getLocalDevice(type);
                HdmiCecLocalDevice localDevice = mCecController.getLocalDevice(type);
                if (localDevice == null) {
                if (localDevice == null) {
                    localDevice = HdmiCecLocalDevice.create(this, type);
                    localDevice = HdmiCecLocalDevice.create(this, type);