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

View File

@ -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)) {