Commit 55559e12 by Jeroen Weener Committed by GitHub

Update Android version mentions (#1135)

parent b730a81f
## 3.11.5
* Updates the mentions of Android versions throughout the plugin, now following a format of 'Android {name} (API {number})'. For example: 'Android 13 (API 33)'.
## 3.11.4 ## 3.11.4
* Clarifies the documentation on requesting background location permission * Clarifies the documentation on requesting background location permission
through `Permission.locationAlways` on Android 10+ (API 29+). through `Permission.locationAlways` on Android 10+ (API 29+).
......
...@@ -24,7 +24,9 @@ enum PermissionStatus { ...@@ -24,7 +24,9 @@ enum PermissionStatus {
/// still change the permission status in the settings. /// still change the permission status in the settings.
permanentlyDenied, permanentlyDenied,
/// The application is provisionally authorized to post noninterruptive user notifications. /// The application is provisionally authorized to post noninterruptive user
/// notifications.
///
/// *Only supported on iOS (iOS12+).* /// *Only supported on iOS (iOS12+).*
provisional, provisional,
} }
...@@ -80,9 +82,10 @@ extension PermissionStatusGetters on PermissionStatus { ...@@ -80,9 +82,10 @@ extension PermissionStatusGetters on PermissionStatus {
bool get isRestricted => this == PermissionStatus.restricted; bool get isRestricted => this == PermissionStatus.restricted;
/// *On Android:* /// *On Android:*
/// If the user denied access to the requested feature and selected to never /// Android 11+ (API 30+): whether the user denied the permission for a second
/// again show a request for this permission (pre API 30) or the user denied /// time.
/// permissions for a second time (API 30 and higher). /// Below Android 11 (API 30): whether the user denied access to the requested
/// feature and selected to never again show a request.
/// The user may still change the permission status in the settings. /// The user may still change the permission status in the settings.
/// ///
/// *On iOS:* /// *On iOS:*
...@@ -96,7 +99,8 @@ extension PermissionStatusGetters on PermissionStatus { ...@@ -96,7 +99,8 @@ extension PermissionStatusGetters on PermissionStatus {
/// Indicates that permission for limited use of the resource is granted. /// Indicates that permission for limited use of the resource is granted.
bool get isLimited => this == PermissionStatus.limited; bool get isLimited => this == PermissionStatus.limited;
/// If the application is provisionally authorized to post noninterruptive user notifications. /// If the application is provisionally authorized to post noninterruptive
/// user notifications.
bool get isProvisional => this == PermissionStatus.provisional; bool get isProvisional => this == PermissionStatus.provisional;
} }
...@@ -111,13 +115,15 @@ extension FuturePermissionStatusGetters on Future<PermissionStatus> { ...@@ -111,13 +115,15 @@ extension FuturePermissionStatusGetters on Future<PermissionStatus> {
/// If the OS denied access to the requested feature. The user cannot change /// If the OS denied access to the requested feature. The user cannot change
/// this app's status, possibly due to active restrictions such as parental /// this app's status, possibly due to active restrictions such as parental
/// controls being in place. /// controls being in place.
///
/// *Only supported on iOS.* /// *Only supported on iOS.*
Future<bool> get isRestricted async => (await this).isRestricted; Future<bool> get isRestricted async => (await this).isRestricted;
/// *On Android:* /// *On Android:*
/// If the user denied access to the requested feature and selected to never /// Android 11+ (API 30+): whether the user denied the permission for a second
/// again show a request for this permission (pre API 30) or the user denied /// time.
/// permissions for a second time (API 30 and higher). /// Below Android 11 (API 30): whether the user denied access to the requested
/// feature and selected to never again show a request.
/// The user may still change the permission status in the settings. /// The user may still change the permission status in the settings.
/// ///
/// *On iOS:* /// *On iOS:*
...@@ -129,7 +135,9 @@ extension FuturePermissionStatusGetters on Future<PermissionStatus> { ...@@ -129,7 +135,9 @@ extension FuturePermissionStatusGetters on Future<PermissionStatus> {
/// Indicates that permission for limited use of the resource is granted. /// Indicates that permission for limited use of the resource is granted.
Future<bool> get isLimited async => (await this).isLimited; Future<bool> get isLimited async => (await this).isLimited;
/// If the application is provisionally authorized to post noninterruptive user notifications. /// If the application is provisionally authorized to post noninterruptive
/// user notifications.
///
/// *Only supported on iOS.* /// *Only supported on iOS.*
Future<bool> get isProvisional async => (await this).isProvisional; Future<bool> get isProvisional async => (await this).isProvisional;
} }
...@@ -56,14 +56,15 @@ class Permission { ...@@ -56,14 +56,15 @@ class Permission {
/// different: /// different:
/// ///
/// **Android:** /// **Android:**
/// - When running on Android Q and above: Background Location Permission. /// - When running on Android 10 (API 29) and above: Background Location
/// <br>**Please note**: To request this permission, the user needs to grant foreground /// Permission.
/// location permissions first. You can do this by using either /// <p>**Please note**: To request this permission, the user needs to grant
/// foreground location permissions first. You can do this by using either
/// [Permission.location] or [Permission.locationWhenInUse]. Then, requesting /// [Permission.location] or [Permission.locationWhenInUse]. Then, requesting
/// [Permission.locationAlways] will show an additional dialog or open the /// [Permission.locationAlways] will show an additional dialog or open the
/// location permission app settings, allowing the user to change the location /// location permission app settings, allowing the user to change the location
/// access to 'allow all the time'. /// access to 'allow all the time'.
/// - When running on Android < Q: Fine and Coarse Location /// - When running below Android 10 (API 29): Fine and Coarse Location
/// ///
/// **iOS:** CoreLocation - Always /// **iOS:** CoreLocation - Always
static const locationAlways = PermissionWithService._(4); static const locationAlways = PermissionWithService._(4);
...@@ -93,9 +94,9 @@ class Permission { ...@@ -93,9 +94,9 @@ class Permission {
/// different: /// different:
/// ///
/// **Android:** /// **Android:**
/// - When running on Android TIRAMISU and above: Read image files from /// - When running on Android 13 (API 33) and above: Read image files from
/// external storage /// external storage
/// - When running on Android < TIRAMISU: Nothing /// - When running below Android 13 (API 33): Nothing
/// ///
/// **iOS:** /// **iOS:**
/// - When running Photos (iOS 14+ read & write access level) /// - When running Photos (iOS 14+ read & write access level)
...@@ -138,12 +139,12 @@ class Permission { ...@@ -138,12 +139,12 @@ class Permission {
/// different: /// different:
/// ///
/// **Android:** /// **Android:**
/// - On Android TIRAMISU and higher this permission is deprecated and always /// - On Android 13 (API 33) and above, this permission is deprecated and
/// returns `PermissionStatus.denied`, instead use `Permission.photos`, /// always returns `PermissionStatus.denied`. Instead use `Permission.photos`,
/// `Permission.video`, `Permission.audio` or /// `Permission.video`, `Permission.audio` or
/// `Permission.manageExternalStorage`. For more information see our /// `Permission.manageExternalStorage`. For more information see our
/// [FAQ](https://pub.dev/packages/permission_handler#faq). /// [FAQ](https://pub.dev/packages/permission_handler#faq).
/// - On Android < TIRAMISU the `READ_EXTERNAL_STORAGE` and /// - Below Android 13 (API 33), the `READ_EXTERNAL_STORAGE` and
/// `WRITE_EXTERNAL_STORAGE` permissions are requested (depending on the /// `WRITE_EXTERNAL_STORAGE` permissions are requested (depending on the
/// definitions in the AndroidManifest.xml) file. /// definitions in the AndroidManifest.xml) file.
/// ///
...@@ -157,13 +158,17 @@ class Permission { ...@@ -157,13 +158,17 @@ class Permission {
/// Permission for pushing notifications. /// Permission for pushing notifications.
static const notification = Permission._(17); static const notification = Permission._(17);
/// Permission for accessing the device's media library (Android Q+ only). /// Permission for accessing the device's media library.
///
/// Android 10+ (API 29+)
/// ///
/// Allows an application to access any geographic locations persisted in the /// Allows an application to access any geographic locations persisted in the
/// user's shared collection. /// user's shared collection.
static const accessMediaLocation = Permission._(18); static const accessMediaLocation = Permission._(18);
/// Permission for accessing the activity recognition (Android Q+ only). /// Permission for accessing the activity recognition.
///
/// Android 10+ (API 29+)
static const activityRecognition = Permission._(19); static const activityRecognition = Permission._(19);
/// The unknown only used for return type, never requested. /// The unknown only used for return type, never requested.
...@@ -193,7 +198,9 @@ class Permission { ...@@ -193,7 +198,9 @@ class Permission {
/// the user for Bluetooth permission if the permission was not yet requested. /// the user for Bluetooth permission if the permission was not yet requested.
static const bluetooth = PermissionWithService._(21); static const bluetooth = PermissionWithService._(21);
/// Permission for accessing the device's external storage. (Android R+ only). /// Permission for accessing the device's external storage.
///
/// Android 11+ (API 30+)
/// ///
/// Allows an application a broad access to external storage in scoped /// Allows an application a broad access to external storage in scoped
/// storage. /// storage.
...@@ -219,7 +226,9 @@ class Permission { ...@@ -219,7 +226,9 @@ class Permission {
/// Allows an app to create windows shown on top of all other apps. /// Allows an app to create windows shown on top of all other apps.
static const systemAlertWindow = Permission._(23); static const systemAlertWindow = Permission._(23);
/// Permission for requesting installing packages (Android M+ only). /// Permission for requesting installing packages.
///
/// Android Marshmallow+ (API 23+)
static const requestInstallPackages = Permission._(24); static const requestInstallPackages = Permission._(24);
/// Permission for accessing the device's tracking state (iOS only). /// Permission for accessing the device's tracking state (iOS only).
...@@ -234,39 +243,57 @@ class Permission { ...@@ -234,39 +243,57 @@ class Permission {
/// Allow for sending notifications that override the ringer. /// Allow for sending notifications that override the ringer.
static const criticalAlerts = Permission._(26); static const criticalAlerts = Permission._(26);
/// Permission for accessing the device's notification policy (Android M+ only). /// Permission for accessing the device's notification policy.
///
/// Android Marshmallow+ (API 23+)
/// ///
/// Allows the user to access the notification policy of the phone. /// Allows the user to access the notification policy of the phone.
/// EX: Allows app to turn on and off do-not-disturb. /// EX: Allows app to turn on and off do-not-disturb.
static const accessNotificationPolicy = Permission._(27); static const accessNotificationPolicy = Permission._(27);
/// Permission for scanning for Bluetooth devices (Android S+ only). /// Permission for scanning for Bluetooth devices.
///
/// Android 12+ (API 31+)
static const bluetoothScan = Permission._(28); static const bluetoothScan = Permission._(28);
/// Permission for advertising Bluetooth devices (Android S+ only). /// Permission for advertising Bluetooth devices
///
/// Android 12+ (API 31+)
/// ///
/// Allows the user to make this device discoverable to other Bluetooth /// Allows the user to make this device discoverable to other Bluetooth
/// devices. /// devices.
static const bluetoothAdvertise = Permission._(29); static const bluetoothAdvertise = Permission._(29);
/// Permission for connecting to Bluetooth devices (Android S+ only). /// Permission for connecting to Bluetooth devices.
///
/// Android 12+ (API 31+)
/// ///
/// Allows the user to connect with already paired Bluetooth devices. /// Allows the user to connect with already paired Bluetooth devices.
static const bluetoothConnect = Permission._(30); static const bluetoothConnect = Permission._(30);
/// Permission for connecting to nearby devices via Wi-Fi (Android T+ only). /// Permission for connecting to nearby devices via Wi-Fi.
///
/// Android 13+ (API 33+)
static const nearbyWifiDevices = Permission._(31); static const nearbyWifiDevices = Permission._(31);
/// Permission for accessing the device's video files from external storage (Android T+ only). /// Permission for accessing the device's video files from external storage.
///
/// Android 13+ (API 33+)
static const videos = Permission._(32); static const videos = Permission._(32);
/// Permission for accessing the device's audio files from external storage (Android T+ only). /// Permission for accessing the device's audio files from external storage.
///
/// Android 13+ (API 33+)
static const audio = Permission._(33); static const audio = Permission._(33);
/// Permission for scheduling exact alarms (Android S+ only). /// Permission for scheduling exact alarms.
///
/// Android 12+ (API 31+)
static const scheduleExactAlarm = Permission._(34); static const scheduleExactAlarm = Permission._(34);
/// Permission for accessing the device's sensors in background (Android T+ only). /// Permission for accessing the device's sensors in background.
///
/// Android 13+ (API 33+)
static const sensorsAlways = Permission._(35); static const sensorsAlways = Permission._(35);
/// Returns a list of all possible [PermissionGroup] values. /// Returns a list of all possible [PermissionGroup] values.
......
...@@ -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.11.4 version: 3.11.5
dependencies: dependencies:
flutter: flutter:
......
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