deactive grace period when receiving screen on action

This commit is contained in:
Daniel Gultsch 2016-06-01 21:51:46 +02:00
parent 45cc33ca36
commit e43a01159c
1 changed files with 8 additions and 1 deletions

View File

@ -545,8 +545,9 @@ public class XmppConnectionService extends Service {
refreshAllPresences(); refreshAllPresences();
} }
break; break;
case Intent.ACTION_SCREEN_OFF:
case Intent.ACTION_SCREEN_ON: case Intent.ACTION_SCREEN_ON:
deactivateGracePeriod();
case Intent.ACTION_SCREEN_OFF:
if (awayWhenScreenOff()) { if (awayWhenScreenOff()) {
refreshAllPresences(); refreshAllPresences();
} }
@ -3059,6 +3060,12 @@ public class XmppConnectionService extends Service {
sendPresencePacket(account, packet); sendPresencePacket(account, packet);
} }
private void deactivateGracePeriod() {
for(Account account : getAccounts()) {
account.deactivateGracePeriod();
}
}
public void refreshAllPresences() { public void refreshAllPresences() {
for (Account account : getAccounts()) { for (Account account : getAccounts()) {
if (!account.isOptionSet(Account.OPTION_DISABLED)) { if (!account.isOptionSet(Account.OPTION_DISABLED)) {