Loading core/api/system-current.txt +3 −3 Original line number Diff line number Diff line Loading @@ -3326,14 +3326,14 @@ package android.hardware.hdmi { public abstract class HdmiClient { method public android.hardware.hdmi.HdmiDeviceInfo getActiveSource(); method public void selectDevice(int, @NonNull android.hardware.hdmi.HdmiClient.SelectDeviceCallback); method public void selectDevice(int, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.hdmi.HdmiClient.OnDeviceSelectedListener); method public void sendKeyEvent(int, boolean); method public void sendVendorCommand(int, byte[], boolean); method public void setVendorCommandListener(@NonNull android.hardware.hdmi.HdmiControlManager.VendorCommandListener); } public static interface HdmiClient.SelectDeviceCallback { method public void onComplete(@android.hardware.hdmi.HdmiControlManager.ControlCallbackResult int, int); public static interface HdmiClient.OnDeviceSelectedListener { method public void onDeviceSelected(@android.hardware.hdmi.HdmiControlManager.ControlCallbackResult int, int); } public final class HdmiControlManager { core/java/android/hardware/hdmi/HdmiClient.java +23 −12 Original line number Diff line number Diff line package android.hardware.hdmi; import android.annotation.CallbackExecutor; import android.annotation.NonNull; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.hardware.hdmi.HdmiControlManager.VendorCommandListener; import android.os.Binder; import android.os.RemoteException; import android.util.Log; import java.util.concurrent.Executor; /** * Parent for classes of various HDMI-CEC device type used to access * the HDMI control system service. Contains methods and data used in common. Loading @@ -28,16 +32,17 @@ public abstract class HdmiClient { } /** * Callback interface used to get the result of {@link #selectDevice}. * Listener interface used to get the result of {@link #selectDevice}. */ public interface SelectDeviceCallback { public interface OnDeviceSelectedListener { /** * Called when the operation is finished. * @param result the result value of {@link #selectDevice} and can have the values mentioned * in {@link HdmiControlShellCommand#getResultString} * @param logicalAddress logical address of the selected device */ void onComplete(@HdmiControlManager.ControlCallbackResult int result, int logicalAddress); void onDeviceSelected(@HdmiControlManager.ControlCallbackResult int result, int logicalAddress); } /** Loading @@ -48,15 +53,19 @@ public abstract class HdmiClient { * containing the result of that call only. * * @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 * @param listener listener to get the result with * @throws {@link IllegalArgumentException} if the {@code listener} is null */ public void selectDevice(int logicalAddress, @NonNull SelectDeviceCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback must not be null."); public void selectDevice( int logicalAddress, @NonNull @CallbackExecutor Executor executor, @NonNull OnDeviceSelectedListener listener) { if (listener == null) { throw new IllegalArgumentException("listener must not be null."); } try { mService.deviceSelect(logicalAddress, getCallbackWrapper(callback, logicalAddress)); mService.deviceSelect(logicalAddress, getCallbackWrapper(logicalAddress, executor, listener)); } catch (RemoteException e) { Log.e(TAG, "failed to select device: ", e); } Loading @@ -65,12 +74,14 @@ public abstract class HdmiClient { /** * @hide */ private static IHdmiControlCallback getCallbackWrapper(final SelectDeviceCallback callback, int logicalAddress) { private static IHdmiControlCallback getCallbackWrapper(int logicalAddress, final Executor executor, final OnDeviceSelectedListener listener) { return new IHdmiControlCallback.Stub() { @Override public void onComplete(int result) { callback.onComplete(result, logicalAddress); Binder.withCleanCallingIdentity( () -> executor.execute(() -> listener.onDeviceSelected(result, logicalAddress))); } }; } Loading core/java/android/hardware/hdmi/HdmiSwitchClient.java +2 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,6 @@ public class HdmiSwitchClient extends HdmiClient { * @see {@link android.media.tv.TvInputHardwareInfo#getHdmiPortId()} * to get portId of a specific TV Input. * @param listener listener to get the result with * * @hide */ @SystemApi Loading @@ -104,8 +103,10 @@ public class HdmiSwitchClient extends HdmiClient { * * @param logicalAddress logical address of the device to select * @param listener listener to get the result with * @deprecated Please use {@link HdmiClient#selectDevice} instead. * @hide */ @Deprecated public void selectDevice( int logicalAddress, @NonNull @CallbackExecutor Executor executor, Loading Loading
core/api/system-current.txt +3 −3 Original line number Diff line number Diff line Loading @@ -3326,14 +3326,14 @@ package android.hardware.hdmi { public abstract class HdmiClient { method public android.hardware.hdmi.HdmiDeviceInfo getActiveSource(); method public void selectDevice(int, @NonNull android.hardware.hdmi.HdmiClient.SelectDeviceCallback); method public void selectDevice(int, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.hdmi.HdmiClient.OnDeviceSelectedListener); method public void sendKeyEvent(int, boolean); method public void sendVendorCommand(int, byte[], boolean); method public void setVendorCommandListener(@NonNull android.hardware.hdmi.HdmiControlManager.VendorCommandListener); } public static interface HdmiClient.SelectDeviceCallback { method public void onComplete(@android.hardware.hdmi.HdmiControlManager.ControlCallbackResult int, int); public static interface HdmiClient.OnDeviceSelectedListener { method public void onDeviceSelected(@android.hardware.hdmi.HdmiControlManager.ControlCallbackResult int, int); } public final class HdmiControlManager {
core/java/android/hardware/hdmi/HdmiClient.java +23 −12 Original line number Diff line number Diff line package android.hardware.hdmi; import android.annotation.CallbackExecutor; import android.annotation.NonNull; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.hardware.hdmi.HdmiControlManager.VendorCommandListener; import android.os.Binder; import android.os.RemoteException; import android.util.Log; import java.util.concurrent.Executor; /** * Parent for classes of various HDMI-CEC device type used to access * the HDMI control system service. Contains methods and data used in common. Loading @@ -28,16 +32,17 @@ public abstract class HdmiClient { } /** * Callback interface used to get the result of {@link #selectDevice}. * Listener interface used to get the result of {@link #selectDevice}. */ public interface SelectDeviceCallback { public interface OnDeviceSelectedListener { /** * Called when the operation is finished. * @param result the result value of {@link #selectDevice} and can have the values mentioned * in {@link HdmiControlShellCommand#getResultString} * @param logicalAddress logical address of the selected device */ void onComplete(@HdmiControlManager.ControlCallbackResult int result, int logicalAddress); void onDeviceSelected(@HdmiControlManager.ControlCallbackResult int result, int logicalAddress); } /** Loading @@ -48,15 +53,19 @@ public abstract class HdmiClient { * containing the result of that call only. * * @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 * @param listener listener to get the result with * @throws {@link IllegalArgumentException} if the {@code listener} is null */ public void selectDevice(int logicalAddress, @NonNull SelectDeviceCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback must not be null."); public void selectDevice( int logicalAddress, @NonNull @CallbackExecutor Executor executor, @NonNull OnDeviceSelectedListener listener) { if (listener == null) { throw new IllegalArgumentException("listener must not be null."); } try { mService.deviceSelect(logicalAddress, getCallbackWrapper(callback, logicalAddress)); mService.deviceSelect(logicalAddress, getCallbackWrapper(logicalAddress, executor, listener)); } catch (RemoteException e) { Log.e(TAG, "failed to select device: ", e); } Loading @@ -65,12 +74,14 @@ public abstract class HdmiClient { /** * @hide */ private static IHdmiControlCallback getCallbackWrapper(final SelectDeviceCallback callback, int logicalAddress) { private static IHdmiControlCallback getCallbackWrapper(int logicalAddress, final Executor executor, final OnDeviceSelectedListener listener) { return new IHdmiControlCallback.Stub() { @Override public void onComplete(int result) { callback.onComplete(result, logicalAddress); Binder.withCleanCallingIdentity( () -> executor.execute(() -> listener.onDeviceSelected(result, logicalAddress))); } }; } Loading
core/java/android/hardware/hdmi/HdmiSwitchClient.java +2 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,6 @@ public class HdmiSwitchClient extends HdmiClient { * @see {@link android.media.tv.TvInputHardwareInfo#getHdmiPortId()} * to get portId of a specific TV Input. * @param listener listener to get the result with * * @hide */ @SystemApi Loading @@ -104,8 +103,10 @@ public class HdmiSwitchClient extends HdmiClient { * * @param logicalAddress logical address of the device to select * @param listener listener to get the result with * @deprecated Please use {@link HdmiClient#selectDevice} instead. * @hide */ @Deprecated public void selectDevice( int logicalAddress, @NonNull @CallbackExecutor Executor executor, Loading