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

feat(device_info_plus): Add isLowRamDevice property to AndroidDeviceInfo #2765

Merged
merged 3 commits into from
Mar 29, 2024

Conversation

muhib349
Copy link
Contributor

@muhib349 muhib349 commented Mar 28, 2024

Description

The idea is to detect whether the running device is on low RAM or not. From ActivityManager we are getting isLowRamDevice() which is added on AndroidDeviceInfo

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

Copy link
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! Thanks for providing an implementation for this!

There are a couple of things that should be changed before we can approve this PR.

Please take a look at the comments left.

@vbuberen vbuberen changed the title feat(device_info_plus): exposed isLowRamDevice property for androidDeviceInfo feat(device_info_plus): Add isLowRamDevice property to AndroidDeviceInfo Mar 28, 2024
Co-authored-by: K. P. Krasiński-Sroka <kpsroka@users.noreply.github.com>
Copy link
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! all good to go

@miquelbeltran miquelbeltran merged commit 1376b03 into fluttercommunity:main Mar 29, 2024
19 checks passed
@muhib349 muhib349 deleted the issue-2759 branch April 5, 2024 00:31
@haashem
Copy link

haashem commented Apr 23, 2024

I'm getting error because there is no value for isLowRamDevice.
it happens only when I hot reload the app.
Any idea?

Screenshot 2024-04-23 at 11 04 17

@miquelbeltran
Copy link
Member

Could be due to the ActivityManager returning null in that situation. Please create a ticket if you can and we will investigate.

@haashem
Copy link

haashem commented Apr 24, 2024

Reference to reported bug, explained how I resolved it.
#2854

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

Successfully merging this pull request may close these issues.

[Request]: Expose value of ActivityManager.isLowRamDevice()
4 participants