Over the last couple months we’ve noticed some issue with delayed notifications on some Huawei devices.
In this article we will explain the issue, the cause and some possible fixes.
This is a known issue with Huawei devices and is being caused by the battery manager and the way it’s trying to save battery.
There are couple settings that can help.
On Android 5 and lower:
On Android 6 and higher:
To investigate this issue further we wrote an application to test delayed notifications on Huawei devices and also on other devices for references. The project can be found under Github.
The relevant code for this test case and delayed notifications are the following.
alarmManager.setExact(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 3 * 1000 , pendingIntent);
If you experience similar issues feel free to discuss in the comments.