Reputation: 27221
If I'm sending some bytes using sendMessage
from Huawei p9 (Android 6.0) into Android Wear (Sony) the messages are not delivered if the screen of handheld device is turned off. The notifications inside wearable are not updated until the screen in the phone is turned on (in 1 minute)! Will setUrgent
help? I already added the application in "list of granded applications" that can work while the screen is off. The application already works in WAKELOCK state.
Is it a feature for all Android 6.0 and newer devices?
IS IT POSSIBLE TO AVOID THIS? ANY CLUES?
Upvotes: 1
Views: 517
Reputation: 11
I've got a Huawei Honor 6X running Android 7.0 and EMUI 5.0. I was having trouble getting notifications on my Pebble Time after the screen was locked due to Huawei's battery optimization service killing off processes. The instructions provided by Vyacheslav may be applicable to previous OS and EMUI versions, but I couldn't find those options on my particular device. His answer did point me in the right direction, though. The notification problem was one of many that ended up being caused by overzealous power management (thanks a lot, Huawei #sarcasm). Here are the instructions for how I excluded apps from battery optimization on my phone:
I'd like to mention that you may also need to go into System > Battery and change the Close apps after screen lock settings for your app. I had already performed this step in a previously unsuccessful attempt to fix the issue. When I have time, I may go back and test to see if both of these changes need to be done or if the battery optimization exclusion on its own takes care of it. In the meantime, if you exclude the app from battery optimization and it's still getting killed, do the lock screen change as well.
Upvotes: 1
Reputation: 27221
I've waste 3 days to find the solution To fix this problem just enable for ALL applications in the preferences:
protect application with battery saver
Detailed:
To access this power profiles section
Go to the System settings. (which you can either find in the quick toggles portion of the notification shade by pulling down the status bar on the top portion of the screen) Scroll down to Advanced Settings and head on over into Battery Manager. Go to Protected Apps selection. (This is what you’re looking for here. and this will control what’s allowed to run when the screen is off and what isn’t.)
http://itechify.com/2016/02/01/how-to-fix-missing-push-notifications-on-huawei-smartphones/
Upvotes: 1