MarmadileManteater / FreeTubeAndroid

A soft fork of FreeTube which brings it to Android (formerly FreeTubeCordova)
GNU Affero General Public License v3.0
243 stars 6 forks source link

[Bug]: The app is keeping the screen on #335

Closed sebbekm closed 2 weeks ago

sebbekm commented 3 months ago

Guidelines

Describe the bug

  1. Open Freetube
  2. Swipe to home/switch to another app and leave the phone for as long as your screen timeout is set at. You will notice that the screen does not turn off

Expected Behavior

It should turn off when not watching a video or when using another app.

Issue Labels

usability issue

FreeTube Version

v0.20.0.116

Operating System Version

Android 13

Installation Method

.apk

Primary API used

Local API

Last Known Working FreeTube Version (If Any)

No response

Additional Information

I have tested freetube on three devices and the bug is there on all of them. I have to force close the app, then the screen turns off as intended.

Nightly Build

MarmadileManteater commented 3 months ago

I have noticed this too, and it bothers me, but I don't know how to fix it at the moment. The wake lock should be being released whenever the app goes into the background.

https://github.com/MarmadileManteater/FreeTubeAndroid/blob/7048a90a2ee0116579ac1cd3e1e2a797ebe80f04/android/app/src/main/java/io/freetubeapp/freetube/MainActivity.kt#L308C1-L316C4

However, it clearly still keeps the screen on when the phone is locked, so I don't know.

sebbekm commented 3 months ago

I have noticed this too, and it bothers me, but I don't know how to fix it at the moment. The wake lock should be being released whenever the app goes into the background.

https://github.com/MarmadileManteater/FreeTubeAndroid/blob/7048a90a2ee0116579ac1cd3e1e2a797ebe80f04/android/app/src/main/java/io/freetubeapp/freetube/MainActivity.kt#L308C1-L316C4

However, it clearly still keeps the screen on when the phone is locked, so I don't know.

That's weird. I hope you find a solution

MarmadileManteater commented 3 months ago

I just pushed changes which should fix this issue. I used a different method for keeping the screen on which should only work when the app is in the foreground. You can download the nightly here to try it out: https://github.com/MarmadileManteater/FreeTubeAndroid/actions/runs/8680496645

nvm I actually found a problem with it.

MarmadileManteater commented 3 months ago

Okay, now, it should be fixed in the nightly. (sry abt that πŸ™ˆ) https://github.com/MarmadileManteater/FreeTubeAndroid/actions/runs/8680564516

sebbekm commented 3 months ago

Okay, now, it should be fixed in the nightly. (sry abt that πŸ™ˆ) https://github.com/MarmadileManteater/FreeTubeAndroid/actions/runs/8680564516

It's working as intended on the two devices I have on me right now, awesome πŸ‘