Future-proofed Bluetooth permission request and improved broadcast receiver (#2331)

I saw a log line  posted [here](https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/2118) that indicates that the permission requirement might be incorrect in the broadcast receiver. Removed it.

I also future-proofed the BLUETOOTH/BLUETOOTH_ADMIN permissions according to Android 12 Beta documentation, there's probably much more than this that has to be updated to be fully Android 12 compliant though.

Co-authored-by: TaaviE <taavi.eomae@gmail.com>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2331
Co-authored-by: TaaviE <taavie@noreply.codeberg.org>
Co-committed-by: TaaviE <taavie@noreply.codeberg.org>
This commit is contained in:
TaaviE
2021-07-02 09:16:17 +02:00
committed by Andreas Shimokawa
co-authored by TaaviE
parent e6cf7e111c
commit e510205b61
+5 -4
View File
@@ -8,8 +8,10 @@
<uses-permission android:name="android.permission.INTERNET" />
-->
<!-- Used for Bluetooth access -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- Since Android 10 -->
@@ -381,8 +383,7 @@
<receiver
android:name=".externalevents.BluetoothStateChangeReceiver"
android:exported="true"
android:permission="android.permission.BLUETOOTH,android.permission.BLUETOOTH_ADMIN">
android:exported="true">
<intent-filter>
<action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
<action android:name="android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED" />