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

Commit efc03355 authored by Sridhar Vashist's avatar Sridhar Vashist Committed by Chris Elliott
Browse files

DO NOT MERGE MediaPlayer: Disable acquiring wakelocks based on property.



Ignore setWakeMode based on system property.
Wakelocks essential for playback will be held by audioflinger.

Change-Id: I413cd873bf21e1e999dbf89a27802fbe1b6022c7
Signed-off-by: default avatarSridhar Vashist <svashist@motorola.com>
parent 0b388d4a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.os.Process;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.provider.Settings;
import android.system.ErrnoException;
import android.system.OsConstants;
@@ -1234,6 +1235,13 @@ public class MediaPlayer implements SubtitleController.Listener
     */
    public void setWakeMode(Context context, int mode) {
        boolean washeld = false;

        /* Disable persistant wakelocks in media player based on property */
        if (SystemProperties.getBoolean("audio.offload.ignore_setawake", false) == true) {
            Log.w(TAG, "IGNORING setWakeMode " + mode);
            return;
        }

        if (mWakeLock != null) {
            if (mWakeLock.isHeld()) {
                washeld = true;