Skip to content

android12崩溃,PendingIntent标志位需要适配 #147

@suyxin

Description

@suyxin
java.lang.IllegalArgumentException: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    at android.app.PendingIntent.checkFlags(PendingIntent.java:378)
    at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:461)
    at android.app.PendingIntent.getActivity(PendingIntent.java:447)
    at android.app.PendingIntent.getActivity(PendingIntent.java:411)
    at com.github.moduth.blockcanary.DisplayService.onBlock(DisplayService.java:46)
    at com.github.moduth.blockcanary.BlockCanaryInternals$1.onBlockEvent(BlockCanaryInternals.java:67)
    at com.github.moduth.blockcanary.LooperMonitor$1.run(LooperMonitor.java:80)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:233)
    at android.os.Looper.loop(Looper.java:344)
    at android.os.HandlerThread.run(HandlerThread.java:67)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions