summaryrefslogtreecommitdiff
path: root/mobile/android
diff options
context:
space:
mode:
authortrav90 <travawine@openmailbox.org>2015-06-09 14:58:09 -0500
committertrav90 <travawine@openmailbox.org>2015-06-09 14:58:09 -0500
commitce1d4976698a9a9cf4252c7ba937a7699153b90b (patch)
tree6d76494305f2cf312a8870fda0b4139b5e8f825f /mobile/android
parent75aed4d49309514de87d522cb8c6b4e62ad6d37c (diff)
downloadpalemoon-gre-ce1d4976698a9a9cf4252c7ba937a7699153b90b.tar.gz
Fix nonstandard case of loading audio in a video element
Diffstat (limited to 'mobile/android')
-rw-r--r--mobile/android/base/GeckoApp.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java
index 3516c08f9..df436f5f8 100644
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -2307,9 +2307,17 @@ abstract public class GeckoApp
PowerManager.WakeLock wl = mWakeLocks.get(topic);
if (state.equals("locked-foreground") && wl == null) {
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
- wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, topic);
- wl.acquire();
- mWakeLocks.put(topic, wl);
+
+ if (CPU.equals(topic)) {
+ wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, topic);
+ } else if (SCREEN.equals(topic)) {
+ wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, topic);
+ }
+
+ if (wl != null) {
+ wl.acquire();
+ mWakeLocks.put(topic, wl);
+ }
} else if (!state.equals("locked-foreground") && wl != null) {
wl.release();
mWakeLocks.remove(topic);