summaryrefslogtreecommitdiff
path: root/mobile/android
diff options
context:
space:
mode:
authorPale Moon <git-repo@palemoon.org>2015-06-14 13:06:11 +0200
committerPale Moon <git-repo@palemoon.org>2015-06-14 13:06:11 +0200
commitcced2593a1fa406a94e928701f913abbe19957b5 (patch)
treeabea303874bd270911f5a4893a49574eed3bc6f5 /mobile/android
parent340bc1011e5b74cacdf6deb0d08890c7d4cfbf21 (diff)
parentd1b35850b2e44a449aa75d7e1d848325c1908ecf (diff)
downloadpalemoon-gre-cced2593a1fa406a94e928701f913abbe19957b5.tar.gz
Merge branch 'master' into Goanna
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);