Skip to content

Commit

Permalink
fix: Update lockscreen detection for various firmwares (#746)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed May 30, 2024
1 parent 3972273 commit 712d01f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ function isShowingLockscreen (dumpsys) {
* @returns {boolean} True if lock screen is shown
*/
export function isInDozingMode(dumpsys) {
return dumpsys.includes('mWakefulness=Dozing');
// On some phones/tablets we were observing mWakefulness=Dozing
// while on others it was getWakefulnessLocked()=Dozing
return /^[\s\w]+wakefulness[^=]*=Dozing$/im.test(dumpsys);
}

/*
Expand Down

0 comments on commit 712d01f

Please sign in to comment.