在 Deep Doze 模式测试中未收到 FCM 高优先级消息

Jit*_*rma 5 android push-notification firebase-cloud-messaging android-doze

我开始使用以下命令在深度打瞌睡模式下测试应用程序:

$ adb shell dumpsys battery unplug
$ adb shell dumpsys deviceidle force-idle
$ adb shell dumpsys deviceidle get deep
Run Code Online (Sandbox Code Playgroud)

检查设备是否处于 IDLE 状态的最后一个命令。

当高优先级推送发送到设备时,应用程序会显示全屏意图通知以显示呼叫屏幕。

最初收到推送并显示屏幕,但在 3-5 次推送后未收到。另外,当我看到日志时,它显示推送已以高优先级收到,但已降级为正常:

Priority: 2 
Original Priority: 1 
Run Code Online (Sandbox Code Playgroud)

onMessageReceived(remoteMessage: RemoteMessage)方法中使用:

remoteMessage.priority
remoteMessage.originalPriority
Run Code Online (Sandbox Code Playgroud)

这些是呼叫邀请高优先级推送,因此 ttl 为 0。

请帮助我了解以下信息:

  1. adb命令$ adb shell dumpsys deviceidle force-idle不利于测试导致测试结果错误吗?
  2. 像我们的例子中那样,全屏意图是否无法防止桶填充降低优先级?
  3. 有没有办法处理它,以便应用程序即使在打瞌睡模式下每次都能收到高优先级推送。