Invalid Notifications and alarms issues in MIUI 14


vmd701

Members
Jun 14, 2023
2
3
Hi All,

I have Redmi Note 12 Pro 5G, currently running official version 14.0.10.0.SMOEUXM. I've read multiple complaints about missing alarms and push notifications in some versions of MIUI 14. I'm experiencing the same problems with the official version and I know that xiaomi.eu roms are based on the official ones, so decided to share my findings.
I have some applications (developed by me) that use the AlarmManager to do some work in background from time to time and noticed that the alarms sometimes stop until these apps are launched again. I thought it is random, but later found it is not random at all and can be reproduced with 100% success. The problem occurs every time after the camera is started and is caused by something called CameraBooster. When the camera is started this appears in the log:

06-12 08:48:31.666 1417 1889 I CameraBooster: camera boost: 0, memThreshold: 0
06-12 08:48:31.666 1417 1889 I CameraBooster: freeMemory: 2533088 cameraThreshold: 2550861
06-12 08:48:31.666 1417 1889 I CameraBooster: getCameraBoostCriticalKillList adjThreshold = 200

Then the system freezes most of the apps, multiple messages like these can be seen in the logcat:

06-12 08:48:31.669 1417 1886 D GreezeManager: FZ uid = 10148 reason =LAUNCH_MODE success !
06-12 08:48:31.669 1417 1886 D GreezeManager: FZ uid = 10148 pid = [ 3981 ] reason : LAUNCH_MODE caller : 16
...
...

After the camera is fully started, multiple messages like this appear in the log:

06-12 08:48:32.010 1417 2215 D GreezeManager: THAW uid = 10103 pid = [ 3728 ] reason : provider caller : 1000
...
...

But, these are only for the system apps, all user-installed apps remain frozen, even these locked in the task manager and with disabled battery optimizations. The TAWN messages for the user apps appear later, most of the time after more than 15 minutes, but not always.

Now the worse part - along with freezing the apps, all their scheduled alarms (or at least these scheduled for the near feature) are not allowed to fire, instead, messages like this appear in the log at the times when the alarms should fire:

06-12 08:49:08.351 1417 1785 D GreezeManager: cached alarm!

These alarms are send later to the apps, sometimes with delay, sometimes only when the app is manually started. Messages like this appear in the log:

06-12 09:00:41.451 1417 1886 D Aurogon : sendPendingAlarm uid = 10261

The whole problem with this is that sometimes these cached alarms are not delivered until the next manual launch of the apps and of course the apps cannot reschedule their background work until the cached alarms are delivered.

The above parts of the log are from my experiment - I use a calendar app which shows notification, I snooze the notification for 1 minute, then start the camera. In 100% of the cases the alarm firing 1 minute later is cached, then sometimes it comes after 15+ minutes, but sometimes if the device goes asleep they do not fire at all until I don't start the app again manually many hours later.

For the push notifications I'm not sure, but I guess the problem is similar and could be also related to the camera booster.

Hope my little investigation will help to the developers of the xiaomi.eu roms :)
 
It's nice and all, but fixing MIUI is not within our power, nor should it be even expected. If it's an official issue, then we rarely intervene.
 
Yes, I was (almost) sure that "Invalid" will be the reaction because I'm reporting problem for the official rom. But:

1) This camera booster is controlled via settings in the build.props file. Can't you make changes in this file to disable it and solve the problem, at least in your roms?
2) I have some hopes that a community like this probably has some contacts with the Xiaomi developers and can make bug reports that are taken more seriously by them.
3) I don't use xiaomi.eu rom, nor I will use it because I don't have time for unlocking, flashing etc. I just try to help here with the idea that your developers can help Xiaomi to fix this in the official rom.

Thanks!