Remove unused PERMISSION_PHOTOS_ADD_ONLY macro (#986) - #1567
Open
ibrahim-iqbal wants to merge 1 commit into
Open
ibrahim-iqbal wants to merge 1 commit into
ibrahim-iqbal wants to merge 1 commit into
Conversation
The `PERMISSION_PHOTOS_ADD_ONLY` compile-time macro was declared in the Objective-C header and defined in `Package.swift`, but no `#ifdef` guarded any code with it. The comment on the `PERMISSION_PHOTOS` define in `Package.swift` already states that "the native code compiles photosAddOnly support under PERMISSION_PHOTOS", which is what actually gates the runtime behaviour. Drop the dead macro from `PermissionHandlerEnums.h` and `Package.swift`, and update the README table so the `PermissionGroup.photosAddOnly` row points at `PERMISSION_PHOTOS` — which is the macro that really enables it — instead of the removed one. No behaviour change on any of the three build systems (CocoaPods, Swift Package Manager, or the CMake tests).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1567 +/- ##
=======================================
Coverage 71.42% 71.42%
=======================================
Files 1 1
Lines 35 35
=======================================
Hits 25 25
Misses 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #986.
The
PERMISSION_PHOTOS_ADD_ONLYmacro was declared inPermissionHandlerEnums.hand defined inPackage.swift, but nothing#ifdefed against it anywhere inpermission_handler_apple/ios/permission_handler_apple/Sources/permission_handler_apple/. The comment on thePERMISSION_PHOTOSdefine inPackage.swift:660-662already says "the native code compiles photosAddOnly support under PERMISSION_PHOTOS" — that macro is what actually gates the runtime behaviour, soPERMISSION_PHOTOS_ADD_ONLYwas just noise.Changes
PermissionHandlerEnums.h: drop the#ifndef PERMISSION_PHOTOS_ADD_ONLY / #define / #endifblock and its comment.Package.swift: drop the corresponding.define("PERMISSION_PHOTOS_ADD_ONLY", ...)entry.permission_handler/README.md: the mapping table row forPermissionGroup.photosAddOnlystill needs to point contributors at the correct macro. Retarget it toPERMISSION_PHOTOS, which matches the code reality described in thePackage.swiftcomment.Pre-launch Checklist
grep -R PERMISSION_PHOTOS_ADD_ONLYon the working tree returns no hits), andenabled()only side-effect is populatingresolvedMacrosfor the verbose diagnostic atPackage.swift:715-719, which just prints one less row now.pubspec.yamlwith an appropriate new version — no runtime behaviour changes on any of the three build paths (CocoaPods, SPM, CMake tests), so no version bump.CHANGELOG.mdto add a description of the change — dead-code removal with no user-visible effect, happy to add an entry if you'd rather this ship with one.main.dart format .and committed any changes (no Dart files touched).flutter analyzeand fixed any errors (no Dart files touched).