dawebmail
dawebmail copied to clipboard
Notifications not showing on non stock Android phones - Mi phone
Investigate the Background Service - the issue is most likely in that area.
It is common issue for Mi phones:
Reason behind bug: By default , Mi phones have a battery profile which clears background processes when device gets locked. (Link to pic)
Solution: Bug can easily solved by changing battery profile (Security app -> Battery -> Profiles) or permanently locking (don't know official term for that) an application by dragging down application icon/window after touching overview button. (Link to pic)
Thanks! It is precisely this issue - have a look here. I spent over two hours on a friend's phone looking into the issue. The alarm requested in BackgroundRunner to run BackgroundService is being cancelled by the battery manager of these phones - which to be honest is a pathetic thing to do.
I'm now trying to understand how apps like Google Keep and other time based reminder apps work by default on these phones - it's a little embarrassing asking users to enable this on their phone. Also, I cant find an intent to open this page on Mi Phones. Do you have an idea on how to open this through intents?
@CreaRo there is no way to curb this bug without informing MIUI users..... Please look at this thread: MIUI forum . There is no work-around. This affects every app i.e. Spotify , Google Keep , even default music app also. However, 3 ways to deal with this: (as mentioned in MIUI forums) (i) Same as I mentioned in above comment. Locking the app . But User have to do it every time after he reboots OR manually clear this app. (ii) Same as mentioned above. Change battery profile to performance. OR more simple way is......... (iii) Go to Security App -> Permissions -> Autostart and set it ON for this app. User have to do it only once.
Whatsapp,Twitter and some other apps have permission for Auto-Start and therefore there are working fine in MIUI devices. I have tested these apps and confirmed this fact.
After trying 3rd option , I am receiving notifications for DAWebmail. Thus , I think it is right way to to solve problem.
@foxtrot9 - Thanks a lot! This is really strange. Quite unbelievable they're allowing the OS to kill vital services of apps. Strangely, this problem exists in OnePlusTwo as well, which runs on CM13. Really strange.
I tried to follow what you're saying on a friend's MI, but I couldn't find the right settings (I find it really hard to use Mi's UI). Have you tried and tested if enabling the correct settings makes notifications work properly?
Also, do you think you could maybe send in a pull request for the same, if you're able to find a way to find the intent that opens settings for the Autostart/battery performance? There is a class called PhoneUtils within the code that is used to find the phone manufacturer. Maybe we could use that to show a dialog box to only particular users.
As you have said:
I tried to follow what you're saying on a friend's MI, but I couldn't find the right settings (I find it really hard to use Mi's UI).
You must have gone to Settings -> System Apps -> Security [which is wrong place.] You can find security app at: On desktop -> Possibly under folder name MI or System -> Security. (There will be a green coloured app.) Pic
Have you tried and tested if enabling the correct settings makes notifications work properly?
@CreaRo Yes, I have tried all 3 solutions on my Mi4i (MIUI 6) and all 3 solutions are working correctly.. Notifications are working after enabling Auto-Start permission for app. Please look at pics. Can you please test them also?
Also, do you think you could maybe send in a pull request for the same, if you're able to find a way to find the intent that opens settings for the Autostart/battery performance? There is a class called PhoneUtils within the code that is used to find the phone manufacturer.
Strangely enough I am not an android developer. :( . May be I can learn Android but I haven't got enough time right now.
Maybe we could use that to show a dialog box to only particular users.
On the suggestion of "Showing dialog box to particular users" , I think I have a possible alternative for that is: Rather than showing users a dialog box , we can however ask for "Auto-Start" permission and edit the source-code for that. (I am don't know how to implement that.)
That's surprising! Thought you'd be a pro coder with such in depth knowledge of services and background processes. Cool cool. I'll look into it.
I found this link and this link.
People haven't been able to find a solution to open auto start- or to auto start apps by code. I'll maybe just have to inform them through a dialog box. Thanks for your help!
I'm happy that I could help.