Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Redmi 14R 5G Android14 ignoreBatteryOptimizations always return denied #1413

Closed
3 of 5 tasks
Hynsen opened this issue Dec 6, 2024 · 1 comment
Closed
3 of 5 tasks

Comments

@Hynsen
Copy link

Hynsen commented Dec 6, 2024

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

   var status = await Permission.ignoreBatteryOptimizations.status;
    if (status == PermissionStatus.granted) {
      return true;
    } else {
      status = await Permission.ignoreBatteryOptimizations.request();
      if (status == PermissionStatus.granted) {
        return true;
      } else {
        return false;
      }
    }

Expected results

reture true

Actual results

return false

Code sample

Code sample
 var status = await Permission.ignoreBatteryOptimizations.status;
    if (status == PermissionStatus.granted) {
      return true;
    } else {
      status = await Permission.ignoreBatteryOptimizations.request();
      if (status == PermissionStatus.granted) {
        return true;
      } else {
        return false;
      }
    }

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

11.3.1

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.1.1 23B81 darwin-arm64, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] Connected device (6 available)
    ! Error: Browsing on the local area network for seventeen. Ensure the device
      is unlocked and attached with a cable or associated with the same local
      area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code
      -27)
[✓] Network resources

• No issues found!
@TimHoogstrate
Copy link
Contributor

Dear @Hynsen,

Don't forget to add the permission to the manifest.

<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

Kind regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants