Loading core/api/system-current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -3319,6 +3319,7 @@ package android.hardware.display { package android.hardware.hdmi { public abstract class HdmiClient { method public void deviceSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback); method public android.hardware.hdmi.HdmiDeviceInfo getActiveSource(); method public void sendKeyEvent(int, boolean); method public void sendVendorCommand(int, byte[], boolean); Loading Loading @@ -3662,7 +3663,7 @@ package android.hardware.hdmi { public final class HdmiTvClient extends android.hardware.hdmi.HdmiClient { method public void clearTimerRecording(int, int, android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource); method public void deviceSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback); method @Deprecated public void deviceSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback); method @Deprecated public java.util.List<android.hardware.hdmi.HdmiDeviceInfo> getDeviceList(); method public int getDeviceType(); method public void portSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback); core/java/android/hardware/hdmi/HdmiClient.java +31 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import android.annotation.NonNull; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.hardware.hdmi.HdmiControlManager.VendorCommandListener; import android.hardware.hdmi.HdmiTvClient.SelectCallback; import android.os.RemoteException; import android.util.Log; Loading @@ -27,6 +28,36 @@ public abstract class HdmiClient { mService = service; } /** * Selects a CEC logical device to be a new active source. * * @param logicalAddress logical address of the device to select * @param callback callback to get the result with * @throws {@link IllegalArgumentException} if the {@code callback} is null */ public void deviceSelect(int logicalAddress, @NonNull SelectCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback must not be null."); } try { mService.deviceSelect(logicalAddress, getCallbackWrapper(callback)); } catch (RemoteException e) { Log.e(TAG, "failed to select device: ", e); } } /** * @hide */ private static IHdmiControlCallback getCallbackWrapper(final SelectCallback callback) { return new IHdmiControlCallback.Stub() { @Override public void onComplete(int result) { callback.onComplete(result); } }; } /** * Returns the active source information. * Loading core/java/android/hardware/hdmi/HdmiTvClient.java +6 −0 Original line number Diff line number Diff line Loading @@ -77,7 +77,9 @@ public final class HdmiTvClient extends HdmiClient { * @param logicalAddress logical address of the device to select * @param callback callback to get the result with * @throws {@link IllegalArgumentException} if the {@code callback} is null * @deprecated Please use {@link HdmiClient#deviceSelect()} instead. */ @Deprecated public void deviceSelect(int logicalAddress, @NonNull SelectCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback must not be null."); Loading @@ -89,6 +91,10 @@ public final class HdmiTvClient extends HdmiClient { } } /** * @deprecated Please use {@link HdmiClient#getCallbackWrapper()} instead. */ @Deprecated private static IHdmiControlCallback getCallbackWrapper(final SelectCallback callback) { return new IHdmiControlCallback.Stub() { @Override Loading Loading
core/api/system-current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -3319,6 +3319,7 @@ package android.hardware.display { package android.hardware.hdmi { public abstract class HdmiClient { method public void deviceSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback); method public android.hardware.hdmi.HdmiDeviceInfo getActiveSource(); method public void sendKeyEvent(int, boolean); method public void sendVendorCommand(int, byte[], boolean); Loading Loading @@ -3662,7 +3663,7 @@ package android.hardware.hdmi { public final class HdmiTvClient extends android.hardware.hdmi.HdmiClient { method public void clearTimerRecording(int, int, android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource); method public void deviceSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback); method @Deprecated public void deviceSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback); method @Deprecated public java.util.List<android.hardware.hdmi.HdmiDeviceInfo> getDeviceList(); method public int getDeviceType(); method public void portSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback);
core/java/android/hardware/hdmi/HdmiClient.java +31 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import android.annotation.NonNull; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.hardware.hdmi.HdmiControlManager.VendorCommandListener; import android.hardware.hdmi.HdmiTvClient.SelectCallback; import android.os.RemoteException; import android.util.Log; Loading @@ -27,6 +28,36 @@ public abstract class HdmiClient { mService = service; } /** * Selects a CEC logical device to be a new active source. * * @param logicalAddress logical address of the device to select * @param callback callback to get the result with * @throws {@link IllegalArgumentException} if the {@code callback} is null */ public void deviceSelect(int logicalAddress, @NonNull SelectCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback must not be null."); } try { mService.deviceSelect(logicalAddress, getCallbackWrapper(callback)); } catch (RemoteException e) { Log.e(TAG, "failed to select device: ", e); } } /** * @hide */ private static IHdmiControlCallback getCallbackWrapper(final SelectCallback callback) { return new IHdmiControlCallback.Stub() { @Override public void onComplete(int result) { callback.onComplete(result); } }; } /** * Returns the active source information. * Loading
core/java/android/hardware/hdmi/HdmiTvClient.java +6 −0 Original line number Diff line number Diff line Loading @@ -77,7 +77,9 @@ public final class HdmiTvClient extends HdmiClient { * @param logicalAddress logical address of the device to select * @param callback callback to get the result with * @throws {@link IllegalArgumentException} if the {@code callback} is null * @deprecated Please use {@link HdmiClient#deviceSelect()} instead. */ @Deprecated public void deviceSelect(int logicalAddress, @NonNull SelectCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback must not be null."); Loading @@ -89,6 +91,10 @@ public final class HdmiTvClient extends HdmiClient { } } /** * @deprecated Please use {@link HdmiClient#getCallbackWrapper()} instead. */ @Deprecated private static IHdmiControlCallback getCallbackWrapper(final SelectCallback callback) { return new IHdmiControlCallback.Stub() { @Override Loading