diff options
author | RoboErik <epastern@google.com> | 2014-07-21 15:19:41 -0700 |
---|---|---|
committer | RoboErik <epastern@google.com> | 2014-07-22 11:06:24 -0700 |
commit | 07920f67c86e80fc78086e21fd446b2531c2defd (patch) | |
tree | aa0b1096b688cff3ffb665dabf54883d93a8f0eb /src/com | |
parent | 72890ce844f92f45c56f3cccd1f2fd03ff12c3c2 (diff) | |
download | android_packages_services_Telecomm-07920f67c86e80fc78086e21fd446b2531c2defd.tar.gz android_packages_services_Telecomm-07920f67c86e80fc78086e21fd446b2531c2defd.tar.bz2 android_packages_services_Telecomm-07920f67c86e80fc78086e21fd446b2531c2defd.zip |
Switch to using AudioAttributes with sessions
We switched sessions to use AudioAttributes instead of an audio stream.
This moves over to the updated API.
Change-Id: Ibc5e9a24ccf3d8cf3fe7d78f63d56aa4c70b006c
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/telecomm/HeadsetMediaButton.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/telecomm/HeadsetMediaButton.java b/src/com/android/telecomm/HeadsetMediaButton.java index 70af0fd8..cca89b9b 100644 --- a/src/com/android/telecomm/HeadsetMediaButton.java +++ b/src/com/android/telecomm/HeadsetMediaButton.java @@ -20,6 +20,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.media.AudioAttributes; import android.media.AudioManager; import android.media.session.MediaSession; import android.media.session.MediaSessionManager; @@ -34,6 +35,10 @@ final class HeadsetMediaButton extends CallsManagerListenerBase { static final int SHORT_PRESS = 1; static final int LONG_PRESS = 2; + private static final AudioAttributes AUDIO_ATTRIBUTES = new AudioAttributes.Builder() + .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH) + .setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION).build(); + private final MediaSession.Callback mSessionCallback = new MediaSession.Callback() { @Override public void onMediaButtonEvent(Intent intent) { @@ -60,7 +65,7 @@ final class HeadsetMediaButton extends CallsManagerListenerBase { mSession.addCallback(mSessionCallback); mSession.setFlags(MediaSession.FLAG_EXCLUSIVE_GLOBAL_PRIORITY | MediaSession.FLAG_HANDLES_MEDIA_BUTTONS); - mSession.setPlaybackToLocal(AudioManager.STREAM_VOICE_CALL); + mSession.setPlaybackToLocal(AUDIO_ATTRIBUTES); } /** |