Unfortunately, I'm unable to comment on Dinariys' solution, but it worked perfectly for the issue .NET MAUI which was driving me crazy. Using a Bluetooth HID scanner on Android and all commands are sent with a carriage return, and the screen was dimming for every scan until focus was reset with an entry or a popup appearing and disappearing back to the page.
Using just that style though made the rest of the app weird, so I just added it to the defualt MAUI splash style, which is usually hidden, but you can grab it, add it to the values folder in Android, and add the line Dinariys used.
https://github.com/dotnet/maui/blob/main/src/Core/src/Platform/Android/Resources/values/styles.xml