Merge "MediaPlayer: Disable acquiring wakelocks based on property." into cw-e-dev am: 50276adde2
am: c54aa0c3f7
* commit 'c54aa0c3f7660a6a35c5ea396ef89f95eefb7c13':
MediaPlayer: Disable acquiring wakelocks based on property.
This commit is contained in:
@ -36,6 +36,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;
|
||||
@ -1260,6 +1261,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;
|
||||
|
Reference in New Issue
Block a user