Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ To know more about breaking changes, see the [Migration Guide][].

## Unreleased

*None.*
**Fixes**

- Fix Android 14+ limited permission photo selection not reflecting deselection in Flutter layer. When users modify their photo selection via `presentLimited()`, the changes are now properly notified to the Flutter layer.

## 3.8.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ class PhotoManagerPlugin(
needPermissions: MutableList<String>,
) {
}

override fun onLimitedSelectionChanged() {
// Send a notification to Flutter that the media library has changed
// so that any listeners can refresh their asset lists
notifyChannel.onOuterChange(
null,
"update",
null,
null,
0
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ interface PermissionsListener {
grantedPermissions: MutableList<String>,
needPermissions: MutableList<String>
)

/**
* Called when the user completes the limited photo selection picker (Android 14+).
* This allows the app to refresh its asset list after the user modifies their selection.
*/
fun onLimitedSelectionChanged() {
// Default empty implementation for backward compatibility
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class PermissionDelegate34 : PermissionDelegate() {
if (requestCode == CODE_REQUEST_LIMITED) {
val handler = resultHandler ?: return
resultHandler = null
// Notify the listener that the user has completed the limited selection
permissionsUtils.permissionsListener?.onLimitedSelectionChanged()
handler.reply(1)
return
}
Expand Down