summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2015-03-23 15:49:12 +0800
committerkaiyiz <kaiyiz@codeaurora.org>2015-03-23 15:49:12 +0800
commitd1c76bf95773acfe97e534f94d7bc4436c837f9c (patch)
tree55cb311b6b10301defbaa8f9882e12b4a0382985 /src
parent670d9b82ab300786cf24c6893f83b406e875ed5a (diff)
downloadandroid_packages_apps_Gallery2-d1c76bf95773acfe97e534f94d7bc4436c837f9c.zip
android_packages_apps_Gallery2-d1c76bf95773acfe97e534f94d7bc4436c837f9c.tar.gz
android_packages_apps_Gallery2-d1c76bf95773acfe97e534f94d7bc4436c837f9c.tar.bz2
Gallery2: Fix wake up the screen, the video does not continue to play.
When security is set to none and wake up the screen,gallery lack of a broadcast to make video continue playing. Add receiver to processing video continue playing when wake up screen. Change-Id: I053f44f17178c3baa79ceea871cd66ec2683a743 CRs-Fixed: 809777
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 0b0341a..1afbc5f 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -563,7 +563,7 @@ public class MovieActivity extends Activity {
AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
super.onStart();
mMovieHooker.onStart();
- registerScreenOff();
+ registerScreenReceiver();
}
@Override
@@ -576,7 +576,7 @@ public class MovieActivity extends Activity {
mControlResumed = false;
}
mMovieHooker.onStop();
- unregisterScreenOff();
+ unregisterScreenReceiver();
}
@Override
@@ -697,7 +697,7 @@ public class MovieActivity extends Activity {
}
// we do not stop live streaming when other dialog overlays it.
- private BroadcastReceiver mScreenOffReceiver = new BroadcastReceiver() {
+ private BroadcastReceiver mScreenReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -711,19 +711,25 @@ public class MovieActivity extends Activity {
mPlayer.onStop();
mControlResumed = false;
}
+ } else if (Intent.ACTION_USER_PRESENT.equals(intent.getAction())) {
+ if (!mControlResumed) {
+ mPlayer.onResume();
+ mControlResumed = true;
+ }
}
}
};
- private void registerScreenOff() {
+ private void registerScreenReceiver() {
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_OFF);
- registerReceiver(mScreenOffReceiver, filter);
+ filter.addAction(Intent.ACTION_USER_PRESENT);
+ registerReceiver(mScreenReceiver, filter);
}
- private void unregisterScreenOff() {
- unregisterReceiver(mScreenOffReceiver);
+ private void unregisterScreenReceiver() {
+ unregisterReceiver(mScreenReceiver);
}
private boolean isKeyguardLocked() {