diff options
author | sceller <sceller999@gmail.com> | 2018-12-11 11:11:22 -0800 |
---|---|---|
committer | Ang Li <angli@google.com> | 2018-12-11 11:11:22 -0800 |
commit | 2e3f116cecba6649979aa916436d90dbace32671 (patch) | |
tree | 0e986614ec75d30362b02a5160455023c759161b /src | |
parent | 598a2323c22f4c1b2ccb3f93976f0a09466d9671 (diff) | |
download | mobly-bundled-snippets-2e3f116cecba6649979aa916436d90dbace32671.tar.gz |
Add RPCs to get/set voice call stream volume (#102)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/android/mobly/snippet/bundled/AudioSnippet.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/com/google/android/mobly/snippet/bundled/AudioSnippet.java b/src/main/java/com/google/android/mobly/snippet/bundled/AudioSnippet.java index cf5331f..9871c4b 100644 --- a/src/main/java/com/google/android/mobly/snippet/bundled/AudioSnippet.java +++ b/src/main/java/com/google/android/mobly/snippet/bundled/AudioSnippet.java @@ -81,6 +81,26 @@ public class AudioSnippet implements Snippet { public void setRingVolume(Integer value) { mAudioManager.setStreamVolume(AudioManager.STREAM_RING, value, 0 /* flags, 0 = no flags */); } + + @Rpc(description = "Gets the voice call volume.") + public int getVoiceCallVolume() { + return mAudioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL); + } + + @Rpc(description = "Gets the maximum voice call volume value.") + public int getVoiceCallMaxVolume() { + return mAudioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL); + } + + @Rpc( + description = + "Sets the voice call stream volume. The minimum value is 0. Use getVoiceCallMaxVolume" + + "to determine the maximum." + ) + public void setVoiceCallVolume(Integer value) { + mAudioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, + value, 0 /* flags, 0 = no flags */); + } @Rpc(description = "Silences all audio streams.") public void muteAll() throws Exception { |