Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04b7d5bd authored by zhuw's avatar zhuw Committed by Gerrit - the friendly Code Review server
Browse files

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
parent 5b873ebc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;
                }
            }