The timer function is implemented using the alarm manager.
The source is as below and I also used the battery optimization options (ACTION_REQUEST_IGNORE_BATTERY_OPTI