summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-03-23 23:57:17 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-03-23 23:57:17 -0700
commit53092a936d354ed5c4e67136c6c535512a3d6599 (patch)
treee0d1bf4f871e375bb953b5033185e436567cec03 /src
parent1a6d80d8b9f8a1b9f59fe40e437c732cb9b3cd6c (diff)
parentd1c76bf95773acfe97e534f94d7bc4436c837f9c (diff)
downloadandroid_packages_apps_Gallery2-53092a936d354ed5c4e67136c6c535512a3d6599.zip
android_packages_apps_Gallery2-53092a936d354ed5c4e67136c6c535512a3d6599.tar.gz
android_packages_apps_Gallery2-53092a936d354ed5c4e67136c6c535512a3d6599.tar.bz2
Merge "Gallery2: Fix wake up the screen, the video does not continue to play."
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() {