summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app
diff options
context:
space:
mode:
authorzhuw <zhuw@codeaurora.org>2018-09-25 18:05:28 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-09-25 19:39:58 -0700
commit04b7d5bd65d21f819d83c35c43fc3486c953ab5c (patch)
tree6b027ea0b450d2258714ecb602919eee890fc10d /src/com/android/gallery3d/app
parent5b873ebc30599be247847b8497ad46ca9393a294 (diff)
downloadandroid_packages_apps_Gallery2-04b7d5bd65d21f819d83c35c43fc3486c953ab5c.tar.gz
android_packages_apps_Gallery2-04b7d5bd65d21f819d83c35c43fc3486c953ab5c.tar.bz2
android_packages_apps_Gallery2-04b7d5bd65d21f819d83c35c43fc3486c953ab5c.zip
Fix video play status error when press power button twice
don't response to ACTION_USER_PRESENT before receive ACTION_SCREEN_OFF Change-Id: Ia8b27551e8b987da235c068c774fb2443df6d910
Diffstat (limited to 'src/com/android/gallery3d/app')
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/app/MovieActivity.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index f5e7a65fb..376338863 100644..100755
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -109,6 +109,7 @@ public class MovieActivity extends AbstractPermissionActivity {
private boolean mIsHeadsetOn = false;
private boolean mVirtualizerSupported = false;
private boolean mBassBoostSupported = false;
+ private boolean mUserPresentReceived = false;
static enum Key {
global_enabled, bb_strength, virt_strength
@@ -751,13 +752,15 @@ public class MovieActivity extends AbstractPermissionActivity {
}
if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
// Only stop video.
- if (mControlResumed) {
+ if (mControlResumed && mUserPresentReceived) {
mPlayer.onStop();
+ mUserPresentReceived = false;
mControlResumed = false;
}
} else if (Intent.ACTION_USER_PRESENT.equals(intent.getAction())) {
- if (!mControlResumed) {
+ if (!mControlResumed && !mUserPresentReceived) {
mPlayer.onResume();
+ mUserPresentReceived = true;
mControlResumed = true;
}
}