How to use HdmiControlService

I am trying to develop an application that can turn on / off the TV via HDMI-CEC. I found that in the Android source project there was a service call HdmiControlService here . But I do not know how to use it.

I know it HdmiControlServiceis available for Android 5.0, so I am changing the sdk version to 21, but it still tells me that can't not resolve symbol HdmiControlService.

Does anyone have any ideas on how to use this api or any code for me.

Many thanks.

+6
source share
1 answer

From Context.javaclass:


    /**
     * Use with {@link #getSystemService} to retrieve a
     * {@link android.hardware.hdmi.HdmiControlManager} for controlling and managing
     * HDMI-CEC protocol.
     *
     * @see #getSystemService
     * @see android.hardware.hdmi.HdmiControlManager
     * @hide
     */
    @SystemApi
    public static final String HDMI_CONTROL_SERVICE = "hdmi_control";

, @SystemApi, @hide, , API. " " .

, ().

+7

Source: https://habr.com/ru/post/1016099/


All Articles