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

fix(sensors_plus): Add protection of reserved samplingPeriod value #2390

Merged
merged 1 commit into from Nov 24, 2023
Merged

Conversation

tlserver
Copy link
Contributor

Description

Since android SensorManager.registerListener() reserved value 0-3 for samplingPeriodUs to SENSOR_DELAY_* constants. If user set the value to 1-3μs in this plugin, it cause android and ios behave differently. Note that 0 is safe.

This PR is to add protection by printing warning message and change the value automatically.

Related Issues

Related #2248

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.

@vbuberen vbuberen merged commit 559faa1 into fluttercommunity:main Nov 24, 2023
13 checks passed
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.

None yet

2 participants