sendMessage 无法正常工作(可穿戴)

sendMessage doesn't work properly (Wearable)

如果我使用 sendMessage 从 Huawei p9 (Android 6.0) 向 Android Wear (Sony) 发送一些字节,如果手持设备的屏幕无法发送消息被关闭。在 phone 中的屏幕打开(1 分钟内)之前,可穿戴设备中的通知不会更新! setUrgent 会有帮助吗?我已经在 "list of granded applications" 中添加了可以在屏幕关闭时运行的应用程序。该应用程序已在 WAKELOCK 状态下运行。

它是否适用于所有 Android 6.0 和更高版本的设备?

是否可以避免这种情况?有什么线索吗?

我浪费了 3 天的时间来寻找解决方案 要解决此问题,只需为 ALL 应用程序启用 在首选项中:

protect application with battery saver

详细:

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/

我有华为荣耀6X 运行 Android 7.0和EMUI 5.0。由于华为的电池优化服务终止进程,屏幕锁定后我无法在 Pebble Time 上收到通知。 Vyacheslav 提供的说明可能适用于以前的 OS 和 EMUI 版本,但我在我的特定设备上找不到这些选项。不过,他的回答确实为我指明了正确的方向。通知问题是最终由过度热心的电源管理引起的众多问题之一(非常感谢,华为#sarcasm)。以下是我如何在我的 phone:

上从电池优化中排除应用程序的说明
  1. 在您的设备上打开设置
  2. 向下滚动列表并select Apps 选项。
  3. Select 设置 选项(靠近屏幕底部的蓝色齿轮)。
  4. Select 高级 部分下的 特殊访问权限 选项。
  5. Select 免于电池优化 选项。
  6. 在列表中找到您的应用并select它。您可能需要将顶部的选项从 Allowed 更改为 All apps 才能看到它。
  7. 将设置从不允许更改为允许,然后select确定.

我想提一下,您可能还需要进入 系统 > 电池 并更改 屏幕锁定后关闭应用程序您的应用程序的设置。我已经在之前未成功解决问题的尝试中执行了此步骤。当我有时间的时候,我可能会回去测试看看是否需要完成这两项更改,或者电池优化排除本身是否可以解决它。同时,如果您从电池优化中排除该应用程序,但它仍然被杀死,请同时更改锁屏界面。