From e43a01159cc511e674ccdfccc3f7fa5f118d4a83 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 1 Jun 2016 21:51:46 +0200 Subject: [PATCH] deactive grace period when receiving screen on action --- .../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 68ad65361..06ecb22b9 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)) {