flutter_foreground_task
flutter_foreground_task copied to clipboard
When connectedDevice and microphone are declared at the same time
When connectedDevice and microphone are declared at the same time, the foreground service cannot be started normally after obtaining Bluetooth permissions. It must be started normally after obtaining microphone permissions. What is going on?
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
<!-- foregroundServiceType: microphone -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<!-- foregroundServiceType: dataSync -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<service
android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
android:foregroundServiceType="connectedDevice|microphone|dataSync"
android:stopWithTask="true"
android:exported="false" />