Skip to content

Commit

Permalink
[APT-10212] Android 13/14 + Exoplayer bugfixes
Browse files Browse the repository at this point in the history
Addresses missing foregroundServiceType. Gets TestApp working for downloads again. Deletes an unused test.  Updates Exoplayer to 2.19.1, which is its last update.

There's a problem with the deprecated version of Exoplayer in that it does not support Android 14. The media3 upgrade script isn't working for Armadillo. As a temporary measure, since Android 14 support is mandatory next month, I've forked Exoplayer and addressed the issue there https://github.com/scribd/ExoPlayer/pull/1/files.
The aar is included manually here with these changes.
  • Loading branch information
kabliz committed Jul 11, 2024
1 parent d9f5bb0 commit 7c5c133
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 30 deletions.
26 changes: 22 additions & 4 deletions Armadillo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,35 @@ android {
}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'

implementation "com.google.android.exoplayer:exoplayer-core:${EXOPLAYER_VERSION}"
implementation "com.google.android.exoplayer:exoplayer-hls:${EXOPLAYER_VERSION}"
implementation "com.google.android.exoplayer:exoplayer-dash:${EXOPLAYER_VERSION}"
implementation "com.google.android.exoplayer:extension-mediasession:${EXOPLAYER_VERSION}"
implementation files('libs/exoplayer-core-release.aar')
implementation "com.google.android.exoplayer:exoplayer-common:${EXOPLAYER_VERSION}"
implementation ("com.google.android.exoplayer:exoplayer-hls:${EXOPLAYER_VERSION}") {
exclude group: 'com.google.android.exoplayer', module: 'exoplayer-core'
}
implementation ("com.google.android.exoplayer:exoplayer-dash:${EXOPLAYER_VERSION}") {
exclude group: 'com.google.android.exoplayer', module: 'exoplayer-core'
}
implementation ("com.google.android.exoplayer:extension-mediasession:${EXOPLAYER_VERSION}"){
exclude group: 'com.google.android.exoplayer', module: 'exoplayer-core'
}
implementation ("com.google.android.exoplayer:exoplayer-database:${EXOPLAYER_VERSION}") {
exclude group: 'com.google.android.exoplayer', module: 'exoplayer-core'
}
implementation ("com.google.android.exoplayer:exoplayer-datasource:${EXOPLAYER_VERSION}") {
exclude group: 'com.google.android.exoplayer', module: 'exoplayer-core'
}
implementation ("com.google.android.exoplayer:exoplayer-extractor:${EXOPLAYER_VERSION}") {
exclude group: 'com.google.android.exoplayer', module: 'exoplayer-core'
}

implementation "io.reactivex.rxjava2:rxjava:${RXJAVA_VERSION}"
implementation "io.reactivex.rxjava2:rxandroid:${RXANDROID_VERSION}"
implementation "com.google.dagger:dagger:${DAGGER_VERSION}"

kapt "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"
implementation 'androidx.media:media:1.6.0'
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:${SERIALIZATON_VERSION}"
Expand Down
Binary file added Armadillo/libs/exoplayer-core-release.aar
Binary file not shown.
3 changes: 3 additions & 0 deletions Armadillo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>

<application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ internal class ArmadilloNotificationDeleteReceiver(val application: Application)
*/
override fun setDeleteIntentOnNotification(notification: Notification) {
val intent = Intent(ArmadilloNotificationDeleteReceiver.ACTION)
intent.`package` = application.packageName
val intentFlag = if (hasSnowCone()) PendingIntent.FLAG_MUTABLE else 0
val pendingIntent = PendingIntent.getBroadcast(application, 0, intent, intentFlag)
notification.deleteIntent = pendingIntent
Expand Down
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Project Armadillo Release Notes

## 1.4.1
- Fixes Download Service issues on Android 14.

## 1.4.0
- Targets Android 14 (SDK 34), with appropriate service permissions.

Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions TestApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-feature
android:name="android.hardware.type.automotive"
Expand Down Expand Up @@ -46,6 +49,7 @@
<service
android:name="com.scribd.armadillo.download.DefaultExoplayerDownloadService"
android:exported="false"
android:foregroundServiceType="dataSync|mediaPlayback"
android:permission="android.permission.FOREGROUND_SERVICE">
<intent-filter>
<action android:name="com.google.android.exoplayer.downloadService.action.INIT"/>
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ org.gradle.jvmargs=-Xmx1536m
# org.gradle.parallel=true
PACKAGE_NAME=com.scribd.armadillo
GRADLE_PLUGIN_VERSION=7.2.0
LIBRARY_VERSION=1.4.0
EXOPLAYER_VERSION=2.17.1
LIBRARY_VERSION=1.4.1
EXOPLAYER_VERSION=2.19.1
RXJAVA_VERSION=2.2.4
RXANDROID_VERSION=2.0.1
DAGGER_VERSION=2.16
Expand Down

0 comments on commit 7c5c133

Please sign in to comment.