diff options
| author | Marco Nelissen <marcone@google.com> | 2013-10-29 13:10:21 -0700 |
|---|---|---|
| committer | Jean-Michel Trivi <jmtrivi@google.com> | 2013-11-01 16:48:55 +0000 |
| commit | 71068f694849353bb99c1906f486fbe29a14c074 (patch) | |
| tree | 5ab9a55a3fa077063a7951d103266009f06c38ed /core/java | |
| parent | 0c3e1df77fe641cd14695302a8af7c4f8ce0e9ee (diff) | |
Use audio focus instead of legacy music command
Bug 8612500
Change-Id: Id443b754d683b9f2d2010ee3a03e54590cda0b48
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/VideoView.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/core/java/android/widget/VideoView.java b/core/java/android/widget/VideoView.java index 478e2992ff43..bb4116ad79d5 100644 --- a/core/java/android/widget/VideoView.java +++ b/core/java/android/widget/VideoView.java @@ -19,7 +19,6 @@ package android.widget; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; -import android.content.Intent; import android.content.res.Resources; import android.graphics.Canvas; import android.media.AudioManager; @@ -291,11 +290,8 @@ public class VideoView extends SurfaceView // not ready for playback just yet, will try again later return; } - // Tell the music playback service to pause - // TODO: these constants need to be published somewhere in the framework. - Intent i = new Intent("com.android.music.musicservicecommand"); - i.putExtra("command", "pause"); - mContext.sendBroadcast(i); + AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); + am.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); // we shouldn't clear the target state, because somebody might have // called start() previously |
