Skip to content

Commit

Permalink
Android 14 support (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ authored Sep 26, 2023
1 parent 68f15f8 commit 068f3c2
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/AppConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.*

object AppConfig {
const val minSdk = 21
const val targetSdk = 33
const val targetSdk = 34
const val compileSdk = 34
// https://developer.android.com/jetpack/androidx/releases/compose-kotlin
const val composeCompiler = "1.5.1"
Expand Down
1 change: 0 additions & 1 deletion pillarbox-analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ android {

defaultConfig {
minSdk = AppConfig.minSdk
targetSdk = AppConfig.targetSdk
version = VersionConfig.versionName()
group = VersionConfig.GROUP

Expand Down
1 change: 0 additions & 1 deletion pillarbox-core-business/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ android {

defaultConfig {
minSdk = AppConfig.minSdk
targetSdk = AppConfig.targetSdk
version = VersionConfig.versionName()
group = VersionConfig.GROUP

Expand Down
2 changes: 1 addition & 1 deletion pillarbox-demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
<application
android:name=".DemoApplication"
android:allowBackup="true"
Expand Down
1 change: 0 additions & 1 deletion pillarbox-player-testutils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ android {

defaultConfig {
minSdk = AppConfig.minSdk
targetSdk = AppConfig.targetSdk

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
Expand Down
1 change: 0 additions & 1 deletion pillarbox-player/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ android {

defaultConfig {
minSdk = AppConfig.minSdk
targetSdk = AppConfig.targetSdk
version = VersionConfig.versionName()
group = VersionConfig.GROUP

Expand Down
6 changes: 6 additions & 0 deletions pillarbox-player/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ And enable foreground service in the top of the manifest:
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
```

And since Android 14 (targetApiVersion = 34) a new permission have to be added:

```xml
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
```

Then in the code you have to use `MediaController` to handle playback, not `PillarboxPlayer`. Pillarbox provide an easy way to retrieve that
`MediaController` with `MediaControllerConnection`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import ch.srgssr.pillarbox.player.utils.PendingIntentUtils
*
* ```xml
* <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
* <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
* ```
* And add your PlaybackService to the application manifest as follow :
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import ch.srgssr.pillarbox.player.utils.PendingIntentUtils
*
* ```xml
* <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
* <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
*
* ```
* And add your PlaybackService to the application manifest as follow :
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import ch.srgssr.pillarbox.player.notification.PillarboxMediaDescriptionAdapter
*
* ```xml
* <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
* <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
*
* ```
* And add your PlaybackService to the application manifest as follow :
*
Expand Down
1 change: 0 additions & 1 deletion pillarbox-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ android {

defaultConfig {
minSdk = AppConfig.minSdk
targetSdk = AppConfig.targetSdk
version = VersionConfig.versionName()
group = VersionConfig.GROUP

Expand Down

0 comments on commit 068f3c2

Please sign in to comment.