Skip to content

应用未在运行时,应用通知会被清除 #827

Description

@fei-ke

当一个应用被加入黑阈列表后,如果由其他应用发送了该应用的通知(通过 NotificationManager#notifyAsPackage 发送),即使该应用未在运行,但是黑阈仍然会触发 force-stop 导致应用通知被清除。

HMSPush 利用了类似的 notifyAsPackage 的方式,使用包名 android 发送通知,但是黑阈用户反馈通知会被自动清除。

StatusBarNotificationgetOpPkg 可以获取真正发送通知的应用,是否能依此来判断通知的归属,不对未在运行的应用执行 force-stop,从而保留通知,或者黑阈能否提供选项,停止应用时忽略有通知正在显示的应用。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions