Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications not showing on non stock Android phones - Mi phone #38

Open
crearo opened this issue Jun 24, 2016 · 8 comments
Open

Notifications not showing on non stock Android phones - Mi phone #38

crearo opened this issue Jun 24, 2016 · 8 comments
Labels

Comments

@crearo
Copy link
Owner

crearo commented Jun 24, 2016

Investigate the Background Service - the issue is most likely in that area.

@crearo crearo added the bug label Jun 24, 2016
@foxtrot9
Copy link

foxtrot9 commented Jun 26, 2016

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)

@crearo
Copy link
Owner Author

crearo commented Jun 27, 2016

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?

@foxtrot9
Copy link

foxtrot9 commented Jun 27, 2016

@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.

@foxtrot9
Copy link

foxtrot9 commented Jun 28, 2016

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.

@crearo
Copy link
Owner Author

crearo commented Jun 28, 2016

@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.

@foxtrot9
Copy link

foxtrot9 commented Jun 29, 2016

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.)

@crearo
Copy link
Owner Author

crearo commented Jun 29, 2016

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!

@foxtrot9
Copy link

I'm happy that I could help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants