aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2020-01-24 16:00:15 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2020-01-24 16:00:15 +0100
commitc172f1ade7a30cd7f722ac7287c05e8ffb173ef1 (patch)
treeeb71240f223e0d91b522518e166b359d49c0b9ab /src/main/java
parentcc78954daa7b239f780e30a62141417448528309 (diff)
try to heal Huawei's energy saving methods
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 98ca81bdc..5f4abb833 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -630,6 +630,7 @@ public class XmppConnectionService extends Service {
MessageSearchTask.search(this, term, onSearchResultsAvailable);
}
+ @SuppressLint("InvalidWakeLockTag")
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
final String action = intent == null ? null : intent.getAction();
@@ -764,6 +765,9 @@ public class XmppConnectionService extends Service {
}
}
synchronized (this) {
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M && Build.MANUFACTURER.equals("Huawei")) {
+ wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "LocationManagerService");
+ }
WakeLockHelper.acquire(wakeLock);
boolean pingNow = ConnectivityManager.CONNECTIVITY_ACTION.equals(action) || (Config.POST_CONNECTIVITY_CHANGE_PING_INTERVAL > 0 && ACTION_POST_CONNECTIVITY_CHANGE.equals(action));
final HashSet<Account> pingCandidates = new HashSet<>();