diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-06-01 21:51:46 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-06-01 21:51:46 +0200 |
commit | e43a01159cc511e674ccdfccc3f7fa5f118d4a83 (patch) | |
tree | 3435f388cf216a5174fc584a0bfca2d8f512a15e /src | |
parent | 45cc33ca36566ed05691a7bf06cf42193e9a6c5e (diff) |
deactive grace period when receiving screen on action
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 9 |
1 files changed, 8 insertions, 1 deletions
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)) { |