chenxiaolong / PixelLight

A flashlight app for Google Pixel devices that uses private APIs to access high brightness modes
GNU General Public License v3.0
10 stars 1 forks source link

Add support for Android 15 #4

Closed chenxiaolong closed 1 month ago

chenxiaolong commented 1 month ago

Android 15 has improved its implementation of while-in-use foreground service restrictions, so the experience will now be degraded. It is no longer possible to toggle the torch state on the lock screen without unlocking the device and the quick settings panel will now be closed after every action. There is no way to work around this.

Starting the TorchService is now done by laundering the foreground service start through a UI-less activity. It's possible this will be patched in futures versions of Android, but for now, it works fine. Other than the notification panel closing, there is no UI jank at all.

This commit also drops support for Android 12 through 14. It's too painful to try to maintain the Android 14 and Android 15 workarounds at the same time. Dropping Android 14 support drastically simplifies the service logic. Users on older Android versions should stick with PixelLight 1.0 anyway, due to the better user experience.

Closes: #3