I'm developing an Islamic Azan (Prayer Time) application and I'm facing a device-specific background execution issue on Infinix Zero 40 (Android 15 / XOS).
The app works perfectly on other devices (Samsung, Vivo, Oppo, Xiaomi, Pixel, etc.), but on my Infinix Zero 40 the scheduled Azan does not reliably play when the app is in the background.
The app uses:
AlarmManager
Exact Alarms
BroadcastReceiver
Foreground Service
WakeLock
BootReceiver
Room Database
Offline Prayer Time Calculator
365-day offline prayer schedule
Prayer times are generated offline and stored locally. The scheduler reads only from the Room database.
The app includes:
SCHEDULE_EXACT_ALARM
USE_EXACT_ALARM
WAKE_LOCK
RECEIVE_BOOT_COMPLETED
FOREGROUND_SERVICE
FOREGROUND_SERVICE_MEDIA_PLAYBACK
Battery optimization is disabled for the app.
When the app is opened, everything works correctly.
Sometimes, after minimizing the app, an Alarm Clock icon appears in the status bar and the scheduled Azan works.
However, after some time the Alarm Clock icon disappears automatically, and the scheduled Azan no longer plays.
If a WhatsApp message, Gmail notification, or another high-priority notification arrives around the prayer time, the Azan suddenly starts playing immediately.
This makes me believe that:
the alarm may already be scheduled,
but the application process is somehow frozen or delayed by XOS,
and another notification wakes the process, causing the pending Azan to execute.
AlarmManager
BroadcastReceiver
Foreground Service
WakeLock
BootReceiver
Exact Alarm permissions
Foreground notification
Battery optimization disabled
Auto-start enabled
Multiple architecture changes
Offline Room Database
Different scheduling logic
The behavior on Infinix remains the same.
Has anyone experienced similar behavior specifically on Infinix / XOS?
Does XOS aggressively freeze AlarmManager or Foreground Service despite all required permissions?
Is there any recommended architecture for reliable scheduled background audio playback on XOS devices?
Are there any known manufacturer-specific workarounds for Infinix devices?
Any suggestions, experiences, or references would be greatly appreciated.
Thank you!
Note: This issue appears to be device-specific, because the same APK works correctly on multiple other Android devices.