Commit f1efd8bd by Yannick Maljaars Committed by GitHub

Added support for new Android media and alarm permissions (#933)

parent adf246fc
## 3.9.0
* Added support for the new Android 13 permissions: SCHEDULE_EXACT_ALARM, READ_MEDIA_IMAGES, READ_MEDIA_VIDEO and READ_MEDIA_AUDIO
## 3.8.0 ## 3.8.0
* Added support for the new Android 13 permission: NEARBY_WIFI_DEVICES. * Added support for the new Android 13 permission: NEARBY_WIFI_DEVICES.
......
...@@ -67,7 +67,8 @@ class Permission { ...@@ -67,7 +67,8 @@ class Permission {
/// iOS: Nothing /// iOS: Nothing
static const phone = PermissionWithService._(8); static const phone = PermissionWithService._(8);
/// Android: Nothing /// When running on Android T and above: Read image files from external storage
/// When running on Android < T: Nothing
/// iOS: Photos /// iOS: Photos
/// iOS 14+ read & write access level /// iOS 14+ read & write access level
static const photos = Permission._(9); static const photos = Permission._(9);
...@@ -180,6 +181,21 @@ class Permission { ...@@ -180,6 +181,21 @@ class Permission {
///iOS: Nothing ///iOS: Nothing
static const nearbyWifiDevices = Permission._(31); static const nearbyWifiDevices = Permission._(31);
/// When running on Android T and above: Read video files from external storage
/// When running on Android < T: Nothing
/// iOS: Nothing
static const videos = Permission._(32);
/// When running on Android T and above: Read audio files from external storage
/// When running on Android < T: Nothing
/// iOS: Nothing
static const audio = Permission._(33);
/// When running on Android S and above: Allows exact alarm functionality
/// When running on Android < S: Nothing
///iOS: Nothing
static const scheduleExactAlarm = Permission._(34);
/// 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,
...@@ -213,7 +229,10 @@ class Permission { ...@@ -213,7 +229,10 @@ class Permission {
bluetoothScan, bluetoothScan,
bluetoothAdvertise, bluetoothAdvertise,
bluetoothConnect, bluetoothConnect,
nearbyWifiDevices nearbyWifiDevices,
videos,
audio,
scheduleExactAlarm
]; ];
static const List<String> _names = <String>[ static const List<String> _names = <String>[
...@@ -248,7 +267,10 @@ class Permission { ...@@ -248,7 +267,10 @@ class Permission {
'bluetoothScan', 'bluetoothScan',
'bluetoothAdvertise', 'bluetoothAdvertise',
'bluetoothConnect', 'bluetoothConnect',
'nearbyWifiDevices' 'nearbyWifiDevices',
'videos',
'audio',
'scheduleExactAlarm'
]; ];
@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.8.0 version: 3.9.0
dependencies: dependencies:
flutter: flutter:
......
...@@ -6,7 +6,7 @@ void main() { ...@@ -6,7 +6,7 @@ void main() {
() { () {
const values = Permission.values; const values = Permission.values;
expect(values.length, 32); expect(values.length, 35);
}); });
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