My device does not have a sim card or any network, Except wifi connection.
Now I am setting repeat alarm for daily which working fine when wifi is connected, But it does not trigger on time when wifi is not connected on the Android tablet.
val pendingIntent = PendingIntent.getBroadcast(context, requestCode, archiveIntent, PendingIntent.FLAG_CANCEL_CURRENT)
val alarms = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
alarms.cancel(pendingIntent)
alarms.setInexactRepeating(AlarmManager.RTC_WAKEUP, updateTime.timeInMillis, AlarmManager.INTERVAL_DAY, pendingIntent)
Here are my observations:
Let say I set an alarm at 7:10 PM and when device time change to 7:10 PM it got the call as expected when wifi is connected all the time.
Now the same scenario in which alarm set for 7:10 PM but when device time change to 7:10 PM but at that time wifi is not connected, Now after 7:11 I turn on my wifi on the device, Just after I connected wifi my previous set alarm got called in this case.
Can anyone know what could be reason alarm does not trigger in time when wifi not connected?
NOTE: In my alarm broadcast I am starting WorkManager which had a constraint that it should start only if there is wifi network connected, But I believe that WorkManager should not affect my alarm trigger.