summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwjiang <wjiang@codeaurora.org>2014-07-11 14:51:00 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-11-13 23:41:21 -0800
commit287a7dc829c6626558c943696d48e0a18789ebf5 (patch)
tree3af495642c15a576d4e1d18c493a46bbc9f9c940 /src
parent0d48a3d7590fac630d9e429fe8b4ffce1bc5065c (diff)
downloadandroid_packages_apps_Gallery2-287a7dc829c6626558c943696d48e0a18789ebf5.tar.gz
android_packages_apps_Gallery2-287a7dc829c6626558c943696d48e0a18789ebf5.tar.bz2
android_packages_apps_Gallery2-287a7dc829c6626558c943696d48e0a18789ebf5.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
Diffstat (limited to 'src')
-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 51019a7e6..f35d172fc 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);
@@ -602,9 +593,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);