Commit 14368466 by Maurits van Beusekom Committed by GitHub

Merge pull request #524 from Baseflow/scoped_storage_platform_interface

Added manage external storage permission
parents a1c2f076 21f3ba28
## 3.2.0
* Added support for manage external storage permission available on Android 10 and up.
## 3.1.3 ## 3.1.3
* Implemented equality operator for `Permission` class; * Implemented equality operator for `Permission` class;
......
...@@ -111,6 +111,24 @@ class Permission { ...@@ -111,6 +111,24 @@ class Permission {
/// When running < iOS 13 or Android this is always allowed. /// When running < iOS 13 or Android this is always allowed.
static const bluetooth = Permission._(21); static const bluetooth = Permission._(21);
/// Android: Allows an application a broad access to external storage in
/// scoped storage.
/// iOS: Nothing
///
/// You should request the Manage External Storage permission only when
/// your app cannot effectively make use of the more privacy-friendly APIs.
/// For more information: https://developer.android.com/training/data-storage/manage-all-files
///
/// When the privacy-friendly APIs (i.e. [Storage Access Framework](https://developer.android.com/guide/topics/providers/document-provider)
/// or the [MediaStore](https://developer.android.com/training/data-storage/shared/media) APIs) is all your app needs the
/// [PermissionGroup.storage] are the only permissions you need to request.
///
/// If the usage of the Manage External Storage permission is needed,
/// you have to fill out the Permission Declaration Form upon submitting
/// your app to the Google Play Store. More details can be found here:
/// https://support.google.com/googleplay/android-developer/answer/9214102#zippy=
static const manageExternalStorage = Permission._(22);
/// Returns a list of all possible [PermissionGroup] values. /// Returns a list of all possible [PermissionGroup] values.
static const List<Permission> values = <Permission>[ static const List<Permission> values = <Permission>[
calendar, calendar,
...@@ -134,7 +152,8 @@ class Permission { ...@@ -134,7 +152,8 @@ class Permission {
accessMediaLocation, accessMediaLocation,
activityRecognition, activityRecognition,
unknown, unknown,
bluetooth bluetooth,
manageExternalStorage
]; ];
static const List<String> _names = <String>[ static const List<String> _names = <String>[
...@@ -160,6 +179,7 @@ class Permission { ...@@ -160,6 +179,7 @@ class Permission {
'activity_recognition', 'activity_recognition',
'unknown', 'unknown',
'bluetooth', 'bluetooth',
'manageExternalStorage'
]; ];
@override @override
......
...@@ -3,7 +3,7 @@ description: A common platform interface for the permission_handler plugin. ...@@ -3,7 +3,7 @@ description: A common platform interface for the permission_handler plugin.
homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a # NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 3.1.3 version: 3.2.0
dependencies: dependencies:
flutter: flutter:
......
...@@ -6,7 +6,7 @@ void main() { ...@@ -6,7 +6,7 @@ void main() {
() { () {
final values = Permission.values; final values = Permission.values;
expect(values.length, 22); expect(values.length, 23);
}); });
test('check if byValue returns corresponding PermissionGroup value', () { test('check if byValue returns corresponding PermissionGroup value', () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment