forked from mirror/monocles_chat_clean
modify away when locked behaviour to locked || screen off
this new behaviour still takes care of not going online when quickly checking for the time but it also includes systems that don’t have a lock screen or incorrectly report being unlocked. (cherry picked from commit bf25b24967a90f19999b569d168efdc984061ad5)
This commit is contained in:
parent
ac37054304
commit
1d28363bfe
1 changed files with 5 additions and 2 deletions
|
@ -1184,7 +1184,10 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
public boolean isScreenLocked() {
|
||||
final KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
|
||||
return keyguardManager != null && keyguardManager.inKeyguardRestrictedInputMode();
|
||||
final PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
final boolean locked = keyguardManager != null && keyguardManager.isKeyguardLocked();
|
||||
final boolean interactive = powerManager != null && powerManager.isInteractive();
|
||||
return locked || !interactive;
|
||||
}
|
||||
|
||||
private boolean isPhoneSilenced() {
|
||||
|
@ -4735,7 +4738,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void sendPresence(final Account account, final boolean includeIdleTimestamp) {
|
||||
Presence.Status status;
|
||||
final Presence.Status status;
|
||||
if (manuallyChangePresence()) {
|
||||
status = account.getPresenceStatus();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue