From e43a01159cc511e674ccdfccc3f7fa5f118d4a83 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 1 Jun 2016 21:51:46 +0200 Subject: deactive grace period when receiving screen on action --- .../eu/siacs/conversations/services/XmppConnectionService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 68ad6536..06ecb22b 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -545,8 +545,9 @@ public class XmppConnectionService extends Service { refreshAllPresences(); } break; - case Intent.ACTION_SCREEN_OFF: case Intent.ACTION_SCREEN_ON: + deactivateGracePeriod(); + case Intent.ACTION_SCREEN_OFF: if (awayWhenScreenOff()) { refreshAllPresences(); } @@ -3059,6 +3060,12 @@ public class XmppConnectionService extends Service { sendPresencePacket(account, packet); } + private void deactivateGracePeriod() { + for(Account account : getAccounts()) { + account.deactivateGracePeriod(); + } + } + public void refreshAllPresences() { for (Account account : getAccounts()) { if (!account.isOptionSet(Account.OPTION_DISABLED)) { -- cgit v1.2.3