79079608

Date: 2024-10-11 20:17:28
Score: 1
Natty:
Report link

I think I can answer to my own 3 and 4 questions following new researchs :

  1. Why the Android documentation says SCHEDULE_EXACT_ALARM is needed for Android 12 AND upon, whereas my VS2022 is not throwing exception when I'm testing on my Android 14 emulator ?
  2. And finally why my Android 14 emulator can trigger exact alarm without this permission ? (I checked my Emulator and "Developper Options" were disable, so no way to bypass this behavior). Unfortunately I can't test real Android 14 device actually.

Even if the documentation is saying that SCHEDULE_EXACT_ALARM is mandatory for Android 12 (api31) and above, it's not true.

There is another way, but introduced since Android Tiramisu (api33) : USE_EXACT_ALARM https://developer.android.com/reference/android/Manifest.permission#USE_EXACT_ALARM

This one "Allows apps to use exact alarms just like with SCHEDULE_EXACT_ALARM but without needing to request this permission from the user.". It is very specific and the app must fit conditions.

It is what I'm using, and so it allows my app on android api_33 (and above) to NOT have SCHEDULE_EXACT_ALARM and works (until the Play Console warning...)

About the point n°2 I think there was an update (between VS, Maui Nugets packages, Emulators etc.) which trigger the warning.

But unfortunately, about the point n°1 it's a mystery : I can't explain why my real Android 12 device, without ANY permissions (checked on his application page) is able to schedule alarm on my TCL T431D.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Vilo