Skip to content

Commit

Permalink
feat: add Android 12 BLUETOOTH_[CONNECT/SCAN] to PermissionsAndroid (#…
Browse files Browse the repository at this point in the history
…31488)

Summary:
This PR adds BLUETOOTH_CONNECT / BLUETOOTH_SCAN, which showed up in the latest Android 12 Preview build as new `dangerous` permissions requiring approval for them.

https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_CONNECT
https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_SCAN

## Changelog

[Android] [Changed] - Add BLUETOOTH_CONNECT and BLUETOOTH_SCAN to PermissionsAndroid

Pull Request resolved: #31488

Test Plan:
```
PermissionsAndroid.BLUETOOTH_CONNECT === 'android.permission.BLUETOOTH_CONNECT'
PermissionsAndroid.BLUETOOTH_SCAN === 'android.permission.BLUETOOTH_SCAN'
```

Reviewed By: yungsters

Differential Revision: D28449023

Pulled By: mdvacca

fbshipit-source-id: 000fc31f5db2996d04a2a5ec7db7c71d0425f52a
  • Loading branch information
iBotPeaches authored and facebook-github-bot committed May 19, 2021
1 parent 2c5f68d commit eeb8e58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Libraries/PermissionsAndroid/NativePermissionsAndroid.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export type PermissionType =
| 'android.permission.RECEIVE_WAP_PUSH'
| 'android.permission.RECEIVE_MMS'
| 'android.permission.READ_EXTERNAL_STORAGE'
| 'android.permission.WRITE_EXTERNAL_STORAGE';
| 'android.permission.WRITE_EXTERNAL_STORAGE'
| 'android.permission.BLUETOOTH_CONNECT'
| 'android.permission.BLUETOOTH_SCAN';
*/

export interface Spec extends TurboModule {
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PermissionsAndroid/PermissionsAndroid.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const PERMISSIONS = Object.freeze({
RECEIVE_MMS: 'android.permission.RECEIVE_MMS',
READ_EXTERNAL_STORAGE: 'android.permission.READ_EXTERNAL_STORAGE',
WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE',
BLUETOOTH_CONNECT: 'android.permission.BLUETOOTH_CONNECT',
BLUETOOTH_SCAN: 'android.permission.BLUETOOTH_SCAN',
});

/**
Expand All @@ -73,6 +75,8 @@ class PermissionsAndroid {
ACCESS_COARSE_LOCATION: string,
ACCESS_FINE_LOCATION: string,
ADD_VOICEMAIL: string,
BLUETOOTH_CONNECT: string,
BLUETOOTH_SCAN: string,
BODY_SENSORS: string,
CALL_PHONE: string,
CAMERA: string,
Expand Down

0 comments on commit eeb8e58

Please sign in to comment.