Commit 161e99ca by Yannick Maljaars Committed by GitHub

Add support for NEARBY_WIFI_DEVICES permission to platform packages (#928)

* Added support for the NEARBY_WIFI_DEVICES permission to platform packages

* Hotfix PermissionUtils.java
parent 14a22a03
## 10.1.0
* Added support for the new Android 13 permission: NEARBY_WIFI_DEVICES.
## 10.0.0
* __BREAKING CHANGE__: Updated Android `compileSdkVersion` to `33` to handle the new `POST_NOTIFICATIONS` permission.
......
......@@ -46,6 +46,7 @@ final class PermissionConstants {
static final int PERMISSION_GROUP_BLUETOOTH_SCAN = 28;
static final int PERMISSION_GROUP_BLUETOOTH_ADVERTISE = 29;
static final int PERMISSION_GROUP_BLUETOOTH_CONNECT = 30;
static final int PERMISSION_GROUP_NEARBY_WIFI_DEVICES = 31;
@Retention(RetentionPolicy.SOURCE)
......@@ -77,7 +78,8 @@ final class PermissionConstants {
PERMISSION_GROUP_ACCESS_NOTIFICATION_POLICY,
PERMISSION_GROUP_BLUETOOTH_SCAN,
PERMISSION_GROUP_BLUETOOTH_ADVERTISE,
PERMISSION_GROUP_BLUETOOTH_CONNECT
PERMISSION_GROUP_BLUETOOTH_CONNECT,
PERMISSION_GROUP_NEARBY_WIFI_DEVICES
})
@interface PermissionGroup {
}
......
......@@ -77,6 +77,8 @@ public class PermissionUtils {
return PermissionConstants.PERMISSION_GROUP_BLUETOOTH_CONNECT;
case Manifest.permission.POST_NOTIFICATIONS:
return PermissionConstants.PERMISSION_GROUP_NOTIFICATION;
case Manifest.permission.NEARBY_WIFI_DEVICES:
return PermissionConstants.PERMISSION_GROUP_NEARBY_WIFI_DEVICES;
default:
return PermissionConstants.PERMISSION_GROUP_UNKNOWN;
}
......@@ -295,6 +297,12 @@ public class PermissionUtils {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && hasPermissionInManifest(context, permissionNames, Manifest.permission.POST_NOTIFICATIONS ))
permissionNames.add(Manifest.permission.POST_NOTIFICATIONS);
break;
case PermissionConstants.PERMISSION_GROUP_NEARBY_WIFI_DEVICES:
// The NEARBY_WIFI_DEVICES permission is introduced in Android 13, meaning we should
// not handle permissions on pre Android 13 devices.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && hasPermissionInManifest(context, permissionNames, Manifest.permission.NEARBY_WIFI_DEVICES ))
permissionNames.add(Manifest.permission.NEARBY_WIFI_DEVICES);
break;
case PermissionConstants.PERMISSION_GROUP_MEDIA_LIBRARY:
case PermissionConstants.PERMISSION_GROUP_PHOTOS:
case PermissionConstants.PERMISSION_GROUP_REMINDERS:
......
......@@ -60,11 +60,12 @@
<!-- Permissions options for the `ignoreBatteryOptimizations` group -->
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<!-- Permissions options for the `bluetooth` group -->
<!-- Permissions options for the `nearby devices` group -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" />
<!-- Permissions options for the `manage external storage` group -->
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
......
name: permission_handler_android
description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.
version: 10.0.0
version: 10.1.0
homepage: https://github.com/baseflow/flutter-permission-handler
environment:
......
## 9.0.5
* Added new Android 13 NEARBY_WIFI_DEVICES permission to PermissionHandlerEnums.h
## 9.0.4
* Add flag inside `UserDefaults` to save whether locationAlways has already been requested and prevent further requests, which would be left unanswered by the system.
......
......@@ -142,6 +142,7 @@ typedef NS_ENUM(int, PermissionGroup) {
PermissionGroupBluetoothScan,
PermissionGroupBluetoothAdvertise,
PermissionGroupBluetoothConnect,
PermissionGroupNearbyWifiDevices
};
typedef NS_ENUM(int, PermissionStatus) {
......
name: permission_handler_apple
description: Permission plugin for Flutter. This plugin provides the iOS API to request and check permissions.
version: 9.0.4
version: 9.0.5
homepage: https://github.com/baseflow/flutter-permission-handler
environment:
......
# 0.1.1
* Added new Android 13 NEARBY_WIFI_DEVICES permission to permission_constants.h
## 0.1.0
* Adds an initial implementation of Windows support for the permission_handler plugin.
name: permission_handler_windows
description: Permission plugin for Flutter. This plugin provides the Windows API to request and check permissions.
version: 0.1.0
version: 0.1.1
homepage: https://github.com/baseflow/flutter-permission-handler
flutter:
......
......@@ -41,7 +41,8 @@ public:
ACCESS_NOTIFICATION_POLICY = 27,
BLUETOOTH_SCAN = 28,
BLUETOOTH_ADVERTISE = 29,
BLUETOOTH_CONNECT = 30
BLUETOOTH_CONNECT = 30,
NEARBY_WIFI_DEVICES = 31
};
//PERMISSION_STATUS
......
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