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: Sridhar Vashist <svashist@motorola.com>
This commit is contained in:
committed by
Chris Elliott
parent
0b388d4a36
commit
efc0335586
@@ -37,6 +37,7 @@ import android.os.Process;
|
|||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
|
import android.os.SystemProperties;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.system.ErrnoException;
|
import android.system.ErrnoException;
|
||||||
import android.system.OsConstants;
|
import android.system.OsConstants;
|
||||||
@@ -1234,6 +1235,13 @@ public class MediaPlayer implements SubtitleController.Listener
|
|||||||
*/
|
*/
|
||||||
public void setWakeMode(Context context, int mode) {
|
public void setWakeMode(Context context, int mode) {
|
||||||
boolean washeld = false;
|
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 != null) {
|
||||||
if (mWakeLock.isHeld()) {
|
if (mWakeLock.isHeld()) {
|
||||||
washeld = true;
|
washeld = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user