Loading core/java/android/hardware/hdmi/HdmiAudioSystemClient.java 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.hdmi; /** * HdmiAudioSystemClient represents HDMI-CEC logical device of type Audio System * in the Android system which acts as an audio system device such as sound bar. * * <p>HdmiAudioSystemClient provides methods that control, get information from TV/Display device * connected through HDMI bus. * * @hide */ public final class HdmiAudioSystemClient extends HdmiClient { private static final String TAG = "HdmiAudioSystemClient"; /* package */ HdmiAudioSystemClient(IHdmiControlService service) { super(service); } /** * TODO(b/110094868): unhide and add @SystemApi for Q * @hide */ @Override public int getDeviceType() { return HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM; } } core/java/android/hardware/hdmi/HdmiControlManager.java +26 −2 Original line number Diff line number Diff line Loading @@ -22,10 +22,10 @@ import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SuppressLint; import android.content.Context; import android.content.pm.PackageManager; import android.annotation.SystemApi; import android.annotation.SystemService; import android.content.Context; import android.content.pm.PackageManager; import android.os.RemoteException; import android.util.ArrayMap; import android.util.Log; Loading Loading @@ -262,6 +262,8 @@ public final class HdmiControlManager { private final boolean mHasPlaybackDevice; // True if we have a logical device of type TV hosted in the system. private final boolean mHasTvDevice; // True if we have a logical device of type audio system hosted in the system. private final boolean mHasAudioSystemDevice; /** * {@hide} - hide this constructor because it has a parameter of type IHdmiControlService, Loading @@ -280,6 +282,7 @@ public final class HdmiControlManager { } mHasTvDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_TV); mHasPlaybackDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_PLAYBACK); mHasAudioSystemDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM); } private static boolean hasDeviceType(int[] types, int type) { Loading @@ -301,6 +304,7 @@ public final class HdmiControlManager { * @return {@link HdmiClient} instance. {@code null} on failure. * See {@link HdmiDeviceInfo#DEVICE_PLAYBACK} * See {@link HdmiDeviceInfo#DEVICE_TV} * See {@link HdmiDeviceInfo#DEVICE_AUDIO_SYSTEM} */ @Nullable @SuppressLint("Doclava125") Loading @@ -313,6 +317,8 @@ public final class HdmiControlManager { return mHasTvDevice ? new HdmiTvClient(mService) : null; case HdmiDeviceInfo.DEVICE_PLAYBACK: return mHasPlaybackDevice ? new HdmiPlaybackClient(mService) : null; case HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM: return mHasAudioSystemDevice ? new HdmiAudioSystemClient(mService) : null; default: return null; } Loading Loading @@ -348,6 +354,24 @@ public final class HdmiControlManager { return (HdmiTvClient) getClient(HdmiDeviceInfo.DEVICE_TV); } /** * Gets an object that represents an HDMI-CEC logical device of type audio system on the system. * * <p>Used to send HDMI control messages to other devices like TV through HDMI bus. It is also * possible to communicate with other logical devices hosted in the same system if the system is * configured to host more than one type of HDMI-CEC logical devices. * * @return {@link HdmiAudioSystemClient} instance. {@code null} on failure. * * TODO(b/110094868): unhide for Q * @hide */ @Nullable @SuppressLint("Doclava125") public HdmiAudioSystemClient getAudioSystemClient() { return (HdmiAudioSystemClient) getClient(HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM); } /** * Controls standby mode of the system. It will also try to turn on/off the connected devices if * necessary. Loading core/java/android/hardware/hdmi/HdmiPlaybackClient.java +2 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,8 @@ import android.util.Log; /** * HdmiPlaybackClient represents HDMI-CEC logical device of type Playback * in the Android system which acts as a playback device such as set-top box. * It provides with methods that control, get information from TV/Display device * * <p>HdmiPlaybackClient provides methods that control, get information from TV/Display device * connected through HDMI bus. * * @hide Loading core/java/android/hardware/hdmi/HdmiTvClient.java +3 −2 Original line number Diff line number Diff line Loading @@ -29,8 +29,9 @@ import java.util.List; /** * HdmiTvClient represents HDMI-CEC logical device of type TV in the Android system * which acts as TV/Display. It provides with methods that manage, interact with other * devices on the CEC bus. * which acts as TV/Display. * * <p>HdmiTvClient provides methods that manage, interact with other devices on the CEC bus. * * @hide */ Loading Loading
core/java/android/hardware/hdmi/HdmiAudioSystemClient.java 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.hdmi; /** * HdmiAudioSystemClient represents HDMI-CEC logical device of type Audio System * in the Android system which acts as an audio system device such as sound bar. * * <p>HdmiAudioSystemClient provides methods that control, get information from TV/Display device * connected through HDMI bus. * * @hide */ public final class HdmiAudioSystemClient extends HdmiClient { private static final String TAG = "HdmiAudioSystemClient"; /* package */ HdmiAudioSystemClient(IHdmiControlService service) { super(service); } /** * TODO(b/110094868): unhide and add @SystemApi for Q * @hide */ @Override public int getDeviceType() { return HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM; } }
core/java/android/hardware/hdmi/HdmiControlManager.java +26 −2 Original line number Diff line number Diff line Loading @@ -22,10 +22,10 @@ import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SuppressLint; import android.content.Context; import android.content.pm.PackageManager; import android.annotation.SystemApi; import android.annotation.SystemService; import android.content.Context; import android.content.pm.PackageManager; import android.os.RemoteException; import android.util.ArrayMap; import android.util.Log; Loading Loading @@ -262,6 +262,8 @@ public final class HdmiControlManager { private final boolean mHasPlaybackDevice; // True if we have a logical device of type TV hosted in the system. private final boolean mHasTvDevice; // True if we have a logical device of type audio system hosted in the system. private final boolean mHasAudioSystemDevice; /** * {@hide} - hide this constructor because it has a parameter of type IHdmiControlService, Loading @@ -280,6 +282,7 @@ public final class HdmiControlManager { } mHasTvDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_TV); mHasPlaybackDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_PLAYBACK); mHasAudioSystemDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM); } private static boolean hasDeviceType(int[] types, int type) { Loading @@ -301,6 +304,7 @@ public final class HdmiControlManager { * @return {@link HdmiClient} instance. {@code null} on failure. * See {@link HdmiDeviceInfo#DEVICE_PLAYBACK} * See {@link HdmiDeviceInfo#DEVICE_TV} * See {@link HdmiDeviceInfo#DEVICE_AUDIO_SYSTEM} */ @Nullable @SuppressLint("Doclava125") Loading @@ -313,6 +317,8 @@ public final class HdmiControlManager { return mHasTvDevice ? new HdmiTvClient(mService) : null; case HdmiDeviceInfo.DEVICE_PLAYBACK: return mHasPlaybackDevice ? new HdmiPlaybackClient(mService) : null; case HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM: return mHasAudioSystemDevice ? new HdmiAudioSystemClient(mService) : null; default: return null; } Loading Loading @@ -348,6 +354,24 @@ public final class HdmiControlManager { return (HdmiTvClient) getClient(HdmiDeviceInfo.DEVICE_TV); } /** * Gets an object that represents an HDMI-CEC logical device of type audio system on the system. * * <p>Used to send HDMI control messages to other devices like TV through HDMI bus. It is also * possible to communicate with other logical devices hosted in the same system if the system is * configured to host more than one type of HDMI-CEC logical devices. * * @return {@link HdmiAudioSystemClient} instance. {@code null} on failure. * * TODO(b/110094868): unhide for Q * @hide */ @Nullable @SuppressLint("Doclava125") public HdmiAudioSystemClient getAudioSystemClient() { return (HdmiAudioSystemClient) getClient(HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM); } /** * Controls standby mode of the system. It will also try to turn on/off the connected devices if * necessary. Loading
core/java/android/hardware/hdmi/HdmiPlaybackClient.java +2 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,8 @@ import android.util.Log; /** * HdmiPlaybackClient represents HDMI-CEC logical device of type Playback * in the Android system which acts as a playback device such as set-top box. * It provides with methods that control, get information from TV/Display device * * <p>HdmiPlaybackClient provides methods that control, get information from TV/Display device * connected through HDMI bus. * * @hide Loading
core/java/android/hardware/hdmi/HdmiTvClient.java +3 −2 Original line number Diff line number Diff line Loading @@ -29,8 +29,9 @@ import java.util.List; /** * HdmiTvClient represents HDMI-CEC logical device of type TV in the Android system * which acts as TV/Display. It provides with methods that manage, interact with other * devices on the CEC bus. * which acts as TV/Display. * * <p>HdmiTvClient provides methods that manage, interact with other devices on the CEC bus. * * @hide */ Loading