Obsolete
Status Update
Comments
mm...@commonsware.com <mm...@commonsware.com> #2
It seems like it's also not restarted when being killed due to a low memory condition. This is a serious issue!
ad...@google.com <ad...@google.com>
ad...@google.com <ad...@google.com> #3
Same as 63618 issue reported before.
mm...@commonsware.com <mm...@commonsware.com> #4
Ruins battery notifications
Description
* What device are you using? (for example, Pixel XL)
PPP1.180208.014 (Pixel)
* What are the steps to reproduce the problem? (Please provide the minimal reproducible test case.)
Step #1: Read
Step #2: Note that the documentation from Step #1 states: "If an app that targets Android P attempts to create a foreground service without requesting FOREGROUND_SERVICE, the system throws a SecurityException."
Step #3: Download
Step #4: Import that project into Android Studio
Step #5: Examine app/src/main/AndroidManifest.xml and notice that it has no <uses-permission> element at all, let alone one for FOREGROUND_SERVICE
Step #6: Examine app/build.gradle and notice that it has targetSdkVersion 'P'
Step #7: Combine the results of Step #2, Step #5, and Step #6 and realize that if this app attempts to start a foreground service, it should crash with a SecurityException
Step #8: Examine app/src/main/java/com/commonsware/android/fakeplayer/PlayerService.java, and notice that it calls startForeground()
Step #9: Combine the results of Step #7 and Step #8 and realize that this app should crash with a SecurityException when you start the service
Step #10: Run the app on an Android P device
Step #11: Click the top button ("Start the Player")
* Issue Category e.g. Framework (platform), NDK (platform), Hardware (CPU, GPU, Sensor, Camera), ART (platform), Runtime Permissions etc
Framework
* What was the expected result?
Per Step #9, the app should crash with a SecurityException, as clicking that button starts PlayerService.
I REPEAT: THE APP SHOULD CRASH WITH A SecurityException.
* What was the actual result?
The foreground service starts just fine, complete with its notification.