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

Add TargetApi annotation in PermissionUtils.java for Android #1122

Merged
merged 11 commits into from
Aug 16, 2024

Conversation

victorsanni
Copy link
Contributor

@victorsanni victorsanni commented Aug 8, 2023

This adds the TargetApi annotation to the getManifestNames method in PermissionUtils.java. On Android, not including the TargetApi annotation to the getManifestNames method in PermissionUtils.java causes StrictMode errors: https://developer.android.com/reference/android/os/StrictMode.

List at least one fixed issue.

Pre-launch Checklist

  • I made sure the project builds.
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I rebased onto main.
  • I added new tests to check the change I am making, or this PR does not need tests.
  • I made sure all existing and new tests are passing.
  • I ran dart format . and committed any changes.
  • I ran flutter analyze and fixed any errors.

@mvanbeusekom
Copy link
Member

Hi @victorsanni,

Can you elaborate why these changes are required? Both Android and iOS are building just fine at the moment and it seems that your changes break the build with the following error in CI:

Lexical or Preprocessor Issue (Xcode): 'strategies/AudioVideoPermissionStrategy.h' file not found
/Users/runner/work/flutter-permission-handler/flutter-permission-handler/permission_handler_apple/ios/Classes/PermissionManager.h:11:8

Parse Issue (Xcode): Could not build module 'permission_handler_apple'
/Users/runner/work/flutter-permission-handler/flutter-permission-handler/permission_handler_apple/example/ios/Runner/GeneratedPluginRegistrant.m:9:8

@victorsanni
Copy link
Contributor Author

victorsanni commented Aug 9, 2023

On Android, not including the TargetApi annotation to the getManifestNames method in PermissionUtils.java causes StrictMode errors: https://developer.android.com/reference/android/os/StrictMode

Same with the implicit fallthrough.

I have reverted the iOS import changes and will move the fallthrough comment to its own PR.

@victorsanni victorsanni changed the title Add needed imports and make file import paths relative on Android and iOS Add TargetApi annotation and fall-through comment in PermissionUtils.java for Android Aug 9, 2023
@victorsanni victorsanni changed the title Add TargetApi annotation and fall-through comment in PermissionUtils.java for Android Add TargetApi annotation in PermissionUtils.java for Android Aug 9, 2023
@mvanbeusekom mvanbeusekom merged commit 39fba43 into Baseflow:main Aug 16, 2024
1 check passed
@victorsanni victorsanni deleted the fix_imports branch August 16, 2024 16:25
dogiaplinh pushed a commit to dogiaplinh/flutter-permission-handler that referenced this pull request Sep 13, 2024
…w#1122)

* added iOS imports

* added java code style suggestions to PermissionUtils.java

* fix PermissionHandlerEnums.h import in Codec.h

* Edited pubspec.yaml and CHANGELOG.md files

* Edited pubspec.yaml and CHANGELOG.md for android

* fixed formatting error in android CHANGELOG

* Remove iOS changes

* Update CHANGELOG.md

* Remove fall through comment in PermissionUtils.java

---------

Co-authored-by: Maurits van Beusekom <[email protected]>
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.

2 participants