Skip to content

[google_maps_flutter] Sometimes requires the WAKE_LOCK permission #42451

@mklim

Description

@mklim

This was uncovered as part of debugging #42349.

Occasionally Maps requests the WAKE_LOCK permission when the virtual display is resized with a default GoogleMap. It's most likely coming from the Google Maps SDK, but there isn't any obvious reason why this should be. There are a few cases I could find in maps that require that permission, but none of them seem to be related to a default map being resized.

  • There's a wearable version of maps that allows for an "ambient mode" that requires WAKE_LOCK.
  • I'm also seeing a GeoFenceHadrwareImpl class in AOSP that also requires a wake lock, but I don't know if that itself is referenced anywhere with Maps. I don't think our plugin should be using either of those, but we are deferring to the SDK so it's hard to really tell.

In addition this reproduces extremely flakily, around 2% of the time in my testing. It's also only seen on Q, implying that it's the Maps SDK interacting with Android somehow.

The plugin should ideally avoid whatever code path requires this permission or at least alert developers to it and ask them to add it to their manifests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consoledependency: androidAndroid team may need to help use: OS-version specificAffects only some versions of the relevant operating systemp: mapsGoogle Maps pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions