Commit 2c1a2b35 by Neal Soni

added accessNotificationPolicy to permissions.dart + fixed tests

parent 5b394f2d
...@@ -72,9 +72,6 @@ post_install do |installer| ...@@ -72,9 +72,6 @@ post_install do |installer|
## dart: PermissionGroup.notification ## dart: PermissionGroup.notification
'PERMISSION_NOTIFICATIONS=1', 'PERMISSION_NOTIFICATIONS=1',
## dart: PermissionGroup.criticalAlerts
'PERMISSION_CRITICAL_ALERTS=1',
## dart: PermissionGroup.mediaLibrary ## dart: PermissionGroup.mediaLibrary
'PERMISSION_MEDIA_LIBRARY=1', 'PERMISSION_MEDIA_LIBRARY=1',
...@@ -86,6 +83,9 @@ post_install do |installer| ...@@ -86,6 +83,9 @@ post_install do |installer|
## dart: PermissionGroup.appTrackingTransparency ## dart: PermissionGroup.appTrackingTransparency
'PERMISSION_APP_TRACKING_TRANSPARENCY=1' 'PERMISSION_APP_TRACKING_TRANSPARENCY=1'
## dart: PermissionGroup.criticalAlerts
'PERMISSION_CRITICAL_ALERTS=1',
] ]
end end
......
...@@ -147,6 +147,11 @@ class Permission { ...@@ -147,6 +147,11 @@ class Permission {
///iOS: Notifications that override your ringer ///iOS: Notifications that override your ringer
static const criticalAlerts = Permission._(26); static const criticalAlerts = Permission._(26);
///Android: Allows the user to access the notification policy of the phone.
/// EX: Allows app to turn on and off do-not-disturb.
///iOS: Nothing
static const accessNotificationPolicy = Permission._(27);
/// 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,
...@@ -175,7 +180,8 @@ class Permission { ...@@ -175,7 +180,8 @@ class Permission {
systemAlertWindow, systemAlertWindow,
requestInstallPackages, requestInstallPackages,
appTrackingTransparency, appTrackingTransparency,
criticalAlerts criticalAlerts,
accessNotificationPolicy,
]; ];
static const List<String> _names = <String>[ static const List<String> _names = <String>[
...@@ -205,7 +211,8 @@ class Permission { ...@@ -205,7 +211,8 @@ class Permission {
'systemAlertWindow', 'systemAlertWindow',
'requestInstallPackages', 'requestInstallPackages',
'appTrackingTransparency', 'appTrackingTransparency',
'criticalAlerts' 'criticalAlerts',
'accessNotificationPolicy',
]; ];
@override @override
......
...@@ -6,7 +6,7 @@ void main() { ...@@ -6,7 +6,7 @@ void main() {
() { () {
final values = Permission.values; final values = Permission.values;
expect(values.length, 26); expect(values.length, 28);
}); });
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