You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue:
If the user revokes the necessary permissions (e.g., FOREGROUND_SERVICE_HEALTH, ACTIVITY_RECOGNITION) via device settings and then returns to the app, the app crashes with the following error:
java.lang.SecurityException: Starting FGS with type health callerApp=ProcessRecord{...} targetSDK=35 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_HEALTH] any of the permissions allOf=false [android.permission.ACTIVITY_RECOGNITION, android.permission.BODY_SENSORS, android.permission.HIGH_SAMPLING_RATE_SENSORS]
Steps to Reproduce:
Start the foreground service in the app.
Go to Settings > Apps > MyApp > Permissions and revoke necessary permissions (ACTIVITY_RECOGNITION, FOREGROUND_SERVICE_HEALTH).
Return to the app.
The app crashes immediately with the error mentioned above.
Is there any way to prevent the app from crashing when the user revokes these permissions while the foreground service is running? Ideally, I would like to catch this scenario and gracefully stop the service before Android forces the crash.
Thank you for your help!
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Issue:
If the user revokes the necessary permissions (e.g., FOREGROUND_SERVICE_HEALTH, ACTIVITY_RECOGNITION) via device settings and then returns to the app, the app crashes with the following error:
java.lang.SecurityException: Starting FGS with type health callerApp=ProcessRecord{...} targetSDK=35 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_HEALTH] any of the permissions allOf=false [android.permission.ACTIVITY_RECOGNITION, android.permission.BODY_SENSORS, android.permission.HIGH_SAMPLING_RATE_SENSORS]
Steps to Reproduce:
Is there any way to prevent the app from crashing when the user revokes these permissions while the foreground service is running? Ideally, I would like to catch this scenario and gracefully stop the service before Android forces the crash.
Thank you for your help!
The text was updated successfully, but these errors were encountered: