Skip to content

android_alarm_manager: "Background start not allowed" on android O #16719

@lucaslcode

Description

@lucaslcode

Steps to Reproduce

Use android_alarm_manager on android O. I had a repeating inexact alarm every 30 minutes.

Logs

04-18 19:11:30.830 1344 2132 W ActivityManager: Background start not allowed: service Intent { flg=0x4 cmp=com.myapp/io.flutter.plugins.androidalarmmanager.AlarmService (has extras) } to com.myapp/io.flutter.plugins.androidalarmmanager.AlarmService from pid=-1 uid=10235 pkg=com.myapp

Possible Solution

This stackoverflow question suggests that using PendingIntent.getForegroundService instead of PendingIntent.getService for API 26+ in the code here will solve it, but I'm not sure, and I don't know if there are side effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions