Open pewaru-333 opened 1 month ago
This
android:showForAllUsers="true"
android:showWhenLocked="true"
android:turnScreenOn="true"
is equals to
setTurnScreenOn(true)
setShowWhenLocked(true)
This just turns on screen immediately with lock (fingerprint/picture/pin), no reason to use it:
with(getSystemService(KEYGUARD_SERVICE) as KeyguardManager) {
requestDismissKeyguard(this, null)
}
Need to use non-deprecated window flags:
window.addFlags(
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
)
On some devices fullscreen notification doesn't work, if schedule it before some time (< 5 min?).
If screen is on, no full screen, just pop up notification.
Works on <= API 29 with adding to manifest:
Searched through another apps, added this code — no success: