summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwjiang <wjiang@codeaurora.org>2014-07-11 14:51:00 +0800
committercretin45 <cretin45@gmail.com>2014-12-15 14:54:30 -0800
commit7bc38aa9311bb1bf60a3d1ec4bf96aa64a1292c6 (patch)
treee25fad6864fc2480170f5cde9a335d13e207c128
parent34f0f73d9d8229d139627db09879d761a45d8a70 (diff)
downloadandroid_packages_apps_Gallery2-7bc38aa9311bb1bf60a3d1ec4bf96aa64a1292c6.tar.gz
android_packages_apps_Gallery2-7bc38aa9311bb1bf60a3d1ec4bf96aa64a1292c6.tar.bz2
android_packages_apps_Gallery2-7bc38aa9311bb1bf60a3d1ec4bf96aa64a1292c6.zip
Gallery2: don't pause background music perminently
Gallery app requests transient audio focus twice and explicitly pauses background music playback. To allow music resume after movie playback exists, remove redundant audio focus request and pause broadcast. CRs-Fixed: 695669 Change-Id: I46b88defc887d3e5b5c97acdc4f5a0a11d486a76
-rwxr-xr-xsrc/com/android/gallery3d/app/MoviePlayer.java12
-rwxr-xr-xsrc/org/codeaurora/gallery3d/video/CodeauroraVideoView.java6
2 files changed, 1 insertions, 17 deletions
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index ea1e80ea7..a4a9df4dd 100755
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -89,11 +89,6 @@ public class MoviePlayer implements
private static final int KEYCODE_MEDIA_PLAY = 126;
private static final int KEYCODE_MEDIA_PAUSE = 127;
- // Copied from MediaPlaybackService in the Music Player app.
- private static final String SERVICECMD = "com.android.music.musicservicecommand";
- private static final String CMDNAME = "command";
- private static final String CMDPAUSE = "pause";
-
private static final String KEY_VIDEO_CAN_SEEK = "video_can_seek";
private static final String KEY_VIDEO_CAN_PAUSE = "video_can_pause";
private static final String KEY_VIDEO_LAST_DURATION = "video_last_duration";
@@ -297,10 +292,6 @@ public class MoviePlayer implements
filter.addAction(Intent.ACTION_SHUTDOWN);
mContext.registerReceiver(mReceiver, filter);
- Intent i = new Intent(SERVICECMD);
- i.putExtra(CMDNAME, CMDPAUSE);
- movieActivity.sendBroadcast(i);
-
if (savedInstance != null) { // this is a resumed activity
mVideoPosition = savedInstance.getInt(KEY_VIDEO_POSITION, 0);
mResumeableTime = savedInstance.getLong(KEY_RESUMEABLE_TIME, Long.MAX_VALUE);
@@ -608,9 +599,6 @@ public class MoviePlayer implements
}
private void doStartVideo(boolean enableFasten, int position, int duration) {
- ((AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE)).requestAudioFocus(
- null, AudioManager.STREAM_MUSIC,
- AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
doStartVideo(enableFasten, position, duration, true);
}
diff --git a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
index f6ed2c550..e3f80f7b6 100755
--- a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
+++ b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
@@ -455,11 +455,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
// 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);
+
// we shouldn't clear the target state, because somebody might have
// called start() previously
release(false);