Skip to content

Commit 2df406c

Browse files
committed
Merge branch 'fix/notification_npe' into minor
2 parents ed856d6 + 228e6bb commit 2df406c

File tree

6 files changed

+216
-181
lines changed

6 files changed

+216
-181
lines changed

audio_service/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## 0.18.13
22

3+
* Fix Android NPE in sendNotificationClicked and onConnected.
4+
* Catch and broadcast async platform exceptions.
35
* Fix setAndroidPlaybackInfo call blocking (@julianscheel).
46
* Pass through missing extras to playFrom.../prepareFrom... (@Ruchit2759).
57

audio_service/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,6 @@ Note: If your app uses a number of different audio plugins, e.g. for audio recor
306306

307307
## Android setup
308308

309-
These instructions assume that your project follows the Flutter 1.12 project template or later. If your project was created prior to 1.12 and uses the old project structure, you can update your project to follow the [new project template](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects).
310-
311-
Additionally:
312-
313309
1. Make the following changes to your project's `AndroidManifest.xml` file:
314310

315311
```xml
@@ -349,7 +345,7 @@ Additionally:
349345
</manifest>
350346
```
351347

352-
Note: when targeting Android 12 or above, you must set `android:exported` on each component that has an intent filter (the main activity, the service and the receiver). If the manifest merging process causes `"Instantiable"` lint warnings, use `tools:ignore="Instantiable"` (as above) to suppress them.
348+
Note: As of Android 12, an app must have permission to restart a foreground service in the background, otherwise a `ForegroundServiceStartNotAllowedException` will be thrown. To avoid such an exception, you can either set `androidStopForegroundOnPause` to `false` in your `AudioServiceConfig` which keeps the service in the foreground during a pause so that restarting the foreground service is unnecessary, or you can keep the default `androidStopForegroundOnPause` setting of `true` (in line with best practices) and request the user to turn of battery optimisation for your app via the [optimize_battery](https://pub.dev/packages/optimize_battery) package. For more information, read [this page](https://developer.android.com/training/monitoring-device-state/doze-standby#support_for_other_use_cases).
353349

354350
2. If you use any custom icons in notification, create the file `android/app/src/main/res/raw/keep.xml` to prevent them from being stripped during the build process:
355351

0 commit comments

Comments
 (0)