diff options
| author | Jungshik Jang <jayjang@google.com> | 2014-07-03 01:26:14 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-02 21:09:42 +0000 |
| commit | cce51190537503bbc8579ad9bd2eef7180e97a6d (patch) | |
| tree | 541d6746a39cad2db58cd6947f1a1b487eaa87aa /core/java/android | |
| parent | 3c23ddeb00748d2f31cf4c691739ff594ffe94f6 (diff) | |
| parent | 41d974631c5f525da49c88d34cecedd5a4cfeda8 (diff) | |
Merge "Add volume callback for Hdmi-Cec system audio mode."
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/hardware/hdmi/HdmiTvClient.java | 28 | ||||
| -rw-r--r-- | core/java/android/hardware/hdmi/IHdmiControlService.aidl | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/hardware/hdmi/HdmiTvClient.java b/core/java/android/hardware/hdmi/HdmiTvClient.java index 85af3d19d0b0..f46be454cebf 100644 --- a/core/java/android/hardware/hdmi/HdmiTvClient.java +++ b/core/java/android/hardware/hdmi/HdmiTvClient.java @@ -69,6 +69,34 @@ public final class HdmiTvClient { } } + /** + * Set system audio volume + * + * @param oldIndex current volume index + * @param newIndex volume index to be set + * @param maxIndex maximum volume index + */ + public void setSystemAudioVolume(int oldIndex, int newIndex, int maxIndex) { + try { + mService.setSystemAudioVolume(oldIndex, newIndex, maxIndex); + } catch (RemoteException e) { + Log.e(TAG, "failed to set volume: ", e); + } + } + + /** + * Set system audio mute status + * + * @param mute {@code true} if muted; otherwise, {@code false} + */ + public void setSystemAudioMute(boolean mute) { + try { + mService.setSystemAudioMute(mute); + } catch (RemoteException e) { + Log.e(TAG, "failed to set mute: ", e); + } + } + private static IHdmiControlCallback getCallbackWrapper(final SelectCallback callback) { return new IHdmiControlCallback.Stub() { @Override diff --git a/core/java/android/hardware/hdmi/IHdmiControlService.aidl b/core/java/android/hardware/hdmi/IHdmiControlService.aidl index f2948e7bdc22..6acd7b92f8f8 100644 --- a/core/java/android/hardware/hdmi/IHdmiControlService.aidl +++ b/core/java/android/hardware/hdmi/IHdmiControlService.aidl @@ -51,4 +51,6 @@ interface IHdmiControlService { void setControlEnabled(boolean enabled); void setArcMode(boolean enabled); void setOption(int option, int value); + oneway void setSystemAudioVolume(int oldIndex, int newIndex, int maxIndex); + oneway void setSystemAudioMute(boolean mute); } |
