Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 3420d61

Browse files
FredericMaTheTimeWalker
authored andcommitted
Correct isScreenOn
1 parent ef6f14b commit 3420d61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

WallPanelApp/src/main/java/xyz/wallpanel/app/network/WallPanelService.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ class WallPanelService : LifecycleService(), MQTTModule.MQTTListener {
213213

214214
private val isScreenOn: Boolean
215215
get() {
216-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH){
216+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT_WATCH){
217217
val powerManager = getSystemService(Context.POWER_SERVICE) as PowerManager
218-
return powerManager.isInteractive
218+
return powerManager.isScreenOn
219219
}
220-
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT_WATCH){
220+
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH){
221221
val displayManager = getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
222222
for (display in displayManager.displays){
223223
return display.state != Display.STATE_OFF

0 commit comments

Comments
 (0)