flutter_background_geolocation icon indicating copy to clipboard operation
flutter_background_geolocation copied to clipboard

High battery usage on Android 15 Beta 4.1

Open zigapovhe opened this issue 6 months ago • 1 comments

Your Environment

  • Plugin version:
  • Platform: Android
  • OS version: Android 15
  • Device manufacturer / model: Pixel 7 / Pixel 7 Pro
  • Flutter info (flutter doctor): [✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64, locale en-SI) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] VS Code (version 1.92.0) [✓] Connected device (5 available) [✓] Network resources
  • Plugin config:
    bg.BackgroundGeolocation.ready(bg.Config(
            desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
            stopOnTerminate: false,
            startOnBoot: true,
            debug: false,
            reset: false,
            enableHeadless: true,
            // Should be kept true for geofencing to work in the terminated state
            backgroundPermissionRationale: bg.PermissionRationale(
                title: xxxx,
                message: xxxx,
                positiveAction: xxxx,
                negativeAction: xxxx,
            notification: bg.Notification(
              title: "xxxx",
              text: "xxxx",
              channelName: "Background Geofence service",
              priority: bg.Config.NOTIFICATION_PRIORITY_MIN,
            ),
            logLevel: bg.Config.LOG_LEVEL_DEBUG))
        .then((bg.State state) {
      if (!state.enabled) {
        // Start the plugin if it is not already enabled
        bg.BackgroundGeolocation.start();
      }
    });

Expected Behavior

I would expect to have the same or at least pretty similar battery consumption on Android 15 as on A14 or A13.

Actual Behavior

The battery consumption is much greater on A15 when app is in background

Steps to Reproduce

Install app (with your plugin of course) on Android 15 with headless mode enabled

Context

We are using your plugin in production for a few months now, it works really well. To prepare our apps for upcoming Android 15 release, we tested all of them on Pixel 7 and Pixel 7 Pro devices (with Android 15 Beta 4.1 installed), but we find out that app which uses your plugin for geofencing is causing high battery consumption. The same device on A14 had 2% of background battery usage while on A15 the percentage was much higher. I'm attaching screenshot below: Screenshot_20240727-001506

zigapovhe avatar Aug 06 '24 12:08 zigapovhe