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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

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
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