summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorSridhar Vashist <svashist@motorola.com>2015-07-27 13:30:21 -0500
committerChris Elliott <chriselliott@google.com>2015-11-23 14:09:25 -0800
commitf60491183def4c46b4026afb4648544e7289ea5f (patch)
tree94a6e15b86a082c696754ccfca3526a88ffe3b7b /media
parentb21b7785678f08e939dbe2e7d7cb5eedae47e1c4 (diff)
downloadframeworks_base-f60491183def4c46b4026afb4648544e7289ea5f.zip
frameworks_base-f60491183def4c46b4026afb4648544e7289ea5f.tar.gz
frameworks_base-f60491183def4c46b4026afb4648544e7289ea5f.tar.bz2
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>
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaPlayer.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 587d494..d1a1077 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -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;