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

Service NOT start at boot time? #45

Open
albertoursino opened this issue Jan 3, 2020 · 6 comments
Open

Service NOT start at boot time? #45

albertoursino opened this issue Jan 3, 2020 · 6 comments

Comments

@albertoursino
Copy link

albertoursino commented Jan 3, 2020

Alessandra Tonin, who I can't mention, pointed out to me that with her phone, a Huawei, the service is not active when the phone is at boot time: you must necessarily open the app for the first time since the phone is started and then it works.
I thought it was necessary to register the BroadcastReceiver at boot time so I wandered around the web finding several things...

I am trying to modify the smslibrary with a fork but I think I am not succeeding.
In doubt, I open this issue.

Thanks and happy new year!

@giovannivelludo
Copy link
Contributor

Does the same issue appear in phones from other brands? What about other Huawei models? What about other phones of the same brand and model?
Theoretically, a manifest-declared receiver should be registered when the app is installed, and then the system can start the app even if it is not running. However, since Android is modified by phone manufacturers before being installed in phones, they can change the way BroadcastReceivers work. So before thinking about how to fix the problem we should identify which models are affected.

@tonin-alessandra
Copy link

My phone is a Huawei P20 Lite (I think 2017 or 2018, I have to check, not the last one in any case), Android 9.0, EMUI 9.1.0.
My sister has the same phone with the same Android version, and I know there's the same problem.
About other brands' phones, all seems working properly on Samsung, we're waiting a feedback from xiaomi's owners.

@tonin-alessandra
Copy link

I don't know about Honor, but on that phones (in particular on View 20) the background service doesn't work, so the phone doesn't ring when app is closed.

@giovannivelludo
Copy link
Contributor

So as far as we know the problem is present only on the Honor View 20 and the Huawei P20 Lite. @tonin-alessandra the source code of your phone's OS should be in one of these two archives: 1, 2. The first link is for Android version 9.0, but I'm not sure if it's for the P20 Lite, while the second link is definitely for the P20 Lite, but Android version 8.0.
Screenshot from 2020-01-04 18-29-58

@giovannivelludo
Copy link
Contributor

giovannivelludo commented Jan 4, 2020

I downloaded the first archive and ran a search for files containing the word BroadcastReceiver in their content, but couldn't find anything useful. I have no other ideas of what to look for to see how Huawei's implementation of BroadcastReceivers differs from the standard Android implementation.
Screenshot from 2020-01-04 19-29-29
EDIT: maybe it has something to do with BroadcastReceivers not being called when the phone is in energy saving mode, or their process being killed almost immediately after they're called? Here it says that

Power saving mode limits background app activitiy, reduces visual effects and disables auto-synchronisation.

In Ultrapower saving mode only certain apps are available.

If the app using this library was tested when power saving mode was active, could you try disabling it?

@tonin-alessandra
Copy link

First of all, thank you for your help @giovannivelludo.
I have no idea of what the problem could be.
I'll try disabling the power saving mode, I'll let you know.
I also think we can ask to Dr. Li, probably he knows more than us.

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

No branches or pull requests

3 participants