aniyomi
aniyomi copied to clipboard
Default brightness (0) doesn't matches device's current brightness.
Steps to reproduce
- Disable remeber and switch last used brightness under player settings.
- Play any video.
- The brightness of the player is now set to zero.
Expected behavior
The default brightness of the PLAYER should be equal to the device's current brightness.
Actual behavior
The default brightness of the player is automatically set to 0, which is 50% of the device's brightness and NOT the current brightness of device thus often blinding users while using the app in an low light enviornment.
Crash logs
No response
Aniyomi version
0.15.2.2
Android version
Android 12
Device
Moto G40 Fusion
Other details
Please fix this ASAP as it often flashes the users with sudden bright screen.
Acknowledgements
- [X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
- [X] I have written a short but informative title.
- [X] If this is an issue with an official extension, I should be opening an issue in the extensions repository.
- [X] If this is an issue with an official manga extension and this issue can be replicated in the Tachiyomi app, that I should be opening an issue in Tachiyomi's extensions repository.
- [X] I have gone through the FAQ and troubleshooting guide.
- [X] I have updated the app to version 0.15.2.2.
- [X] I have updated all installed extensions.
- [X] I will fill out all of the requested information in this form.
Why no one is noticing this issue as it is really annoying to get super bright screen while overlaying anything(ex: messenger chat baubles)
So i did some digging into this issue and found that it's caused by the device's max brightness value being different than the standard.
The code responsible for setting the players brightness is:
Settings.System.getInt(resolver, Settings.System.SCREEN_BRIGHTNESS) / 255f
255: standard max brightness value.
The code will divide the value of brightness of the device by 255 to have a brightness range of 0 to 1. But my device uses 4095 as the max brightness value, when any value is received from the device in the range of 0-4095 it will always be a greater value than the correct brightness if we're dividing by 255.
Let's say i have my brightness as 5%.
-
in case device uses 255:
5% is 12.75
so12.75 / 255 = 0.05
which will have the player's brightness level as the same as the device -
in case device uses 4095:
5% is 204.75
so204.75 / 255 = 0.8
which will have the player's brightness level much higher than the device
So i did some digging into this issue and found that it's caused by the device's max brightness value being different than the standard.
The code responsible for setting the players brightness is:
Settings.System.getInt(resolver, Settings.System.SCREEN_BRIGHTNESS) / 255f
255: standard max brightness value.
The code will divide the value of brightness of the device by 255 to have a brightness range of 0 to 1. But my device uses 4095 as the max brightness value, when any value is received from the device in the range of 0-4095 it will always be a greater value than the correct brightness if we're dividing by 255.
Let's say i have my brightness as 5%.
- in case device uses 255:
5% is 12.75
so12.75 / 255 = 0.05
which will have the player's brightness level as the same as the device- in case device uses 4095:
5% is 204.75
so204.75 / 255 = 0.8
which will have the player's brightness level much higher than the device
So i did some digging into this issue and found that it's caused by the device's max brightness value being different than the standard.
The code responsible for setting the players brightness is:
Settings.System.getInt(resolver, Settings.System.SCREEN_BRIGHTNESS) / 255f
255: standard max brightness value.
The code will divide the value of brightness of the device by 255 to have a brightness range of 0 to 1. But my device uses 4095 as the max brightness value, when any value is received from the device in the range of 0-4095 it will always be a greater value than the correct brightness if we're dividing by 255.
Let's say i have my brightness as 5%.
- in case device uses 255:
5% is 12.75
so12.75 / 255 = 0.05
which will have the player's brightness level as the same as the device- in case device uses 4095:
5% is 204.75
so204.75 / 255 = 0.8
which will have the player's brightness level much higher than the device
So now what? It's not something we can fix right?
https://github.com/aniyomiorg/aniyomi/commit/fb9f46331625b87deceb219a8132c25a99774472