237 Commits

Author SHA1 Message Date
tianyifeng
b531d93b90 Version bump to 1.4.0-rc01
#cherrypick

PiperOrigin-RevId: 648982615
2024-07-03 01:27:39 -07:00
michaelkatz
c07bbd333c Version bump to media3:1.4.0-beta01
#cherrypick

PiperOrigin-RevId: 644352776
2024-06-18 05:52:03 -07:00
tianyifeng
6dbf548253 Version bump to media3:1.4.0-alpha02
#minor-release

PiperOrigin-RevId: 640196724
2024-06-04 10:21:36 -07:00
ibaker
1329821a35 Use kotlinx-coroutines-guava in session demo app
I originally tried switching to `Futures.addCallback` (as a follow-up
to Issue: androidx/media#890), but it seemed like a good chance to go further into
Kotlin-ification.

Before this change, if the connection to the session failed, the app
would hang at the 'waiting' screen with nothing logged (and the music
keeps playing). This behaviour is maintained with the `try/catch` around
the `.await()` call (with additional logging). Without this, the failed
connection causes the `PlayerActivity` to crash and the music in the
background stops. The `try/catch` is used to flag to developers who
might be using this app as an example that connecting to the session
may fail, and they may want to handle that.

This change also switches `this.controller` to be `lateinit` instead of
nullable.

Issue: androidx/media#890
PiperOrigin-RevId: 638948568
2024-05-31 01:28:47 -07:00
ibaker
f73c24a10d Bump Truth dep to 1.4.0 so we can assert directly on Java 8 types
https://truth.dev/faq#java8

Also use this change to remove most test usages of
`Lists.transform(...)` and replace them with `.stream().map(...)`.

PiperOrigin-RevId: 633523904
2024-05-14 03:38:31 -07:00
ibaker
b182e469f6 Standardise leak canary version in constants.gradle
PiperOrigin-RevId: 633505366
2024-05-14 02:51:23 -07:00
michaelkatz
2622e566d3 Version bump to media3:1.4.0-alpha01
#minor-release

PiperOrigin-RevId: 623185060
2024-04-09 09:09:22 -07:00
sheenachhabra
2a5b9afb88 Update Media3 version number
PiperOrigin-RevId: 622211426
2024-04-05 10:15:38 -07:00
jbibik
5a318deb40 Downgrade kotlin plugin version to 1.9.0
Earlier upgrade in 276e0655f4 was too high, since Android Studio Iguana is still bundled with Kotlin plugin with version `232-1.9.0-release-358-AS10227`. The result of the mismatched plugin is a build failure like:

`Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is XXX`

Although according to https://plugins.jetbrains.com/plugin/6954-kotlin, the 1.9.23 is already available. So we will be able to upgrade again soon.

Version 1.9.0 is still good enough for the compose compiler to be 1.5.0+ according to https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility

PiperOrigin-RevId: 619278402
2024-03-26 12:43:44 -07:00
ibaker
6cb25119fb In-line versions only used by exoplayer-media2 extension
Also remove an unused `androidxTestServicesStorageVersion` version.

Issue: androidx/media#1216
PiperOrigin-RevId: 618990983
2024-03-25 16:21:29 -07:00
Gaëtan Muller
d66a3032c1 Update Guava to 33.0.0-android
Following the recommendation in `constants.gradle`:
d13a0f4ec6/constants.gradle (L29-L31)

This PR updates Guava to the version used in the Android repository: 33.0.0.

The changelog for Guava 33.0.0 is available [here](https://github.com/google/guava/releases/tag/v33.0.0).
2024-03-22 16:14:41 +00:00
jbibik
276e0655f4 Upgrade Kotlin version to 1.9.22
This will allow us to use the latest Compose complier version (from https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility) for the future Compose Demo.

PiperOrigin-RevId: 617509694
2024-03-20 07:44:52 -07:00
sheenachhabra
9be7a7ab7f Update media3 version for 1.3.0 stable release
PiperOrigin-RevId: 609745599
2024-02-23 09:10:23 -08:00
bachinger
4777d62d31 Rollback of 8e2869278c
PiperOrigin-RevId: 607264513
2024-02-15 02:35:12 -08:00
asinclair
8e2869278c Internal Cleanup
PiperOrigin-RevId: 607117264
2024-02-14 15:06:10 -08:00
sheenachhabra
a31a384393 Version bump to media3:1.3.0-rc01
#minor-release

PiperOrigin-RevId: 605573991
2024-02-09 02:44:25 -08:00
ibaker
373822ce45 Add a comment to suggest keeping JUnit version in sync with the Android
source tree - to make importing GTS tests easier.

PiperOrigin-RevId: 601725811
2024-01-26 04:14:40 -08:00
sheenachhabra
21ab474260 Version bump to media3:1.3.0-beta01
#minor-release

PiperOrigin-RevId: 601441910
2024-01-25 07:28:43 -08:00
ibaker
520687af28 Bump media1 dep to 1.7.0
This brings in a fix for Issue: androidx/media#489.

PiperOrigin-RevId: 598771006
2024-01-16 02:05:20 -08:00
sheenachhabra
4a07d13838 Version bump to media3:1.3.0-alpha01
#minor-release

PiperOrigin-RevId: 598588547
2024-01-15 05:44:03 -08:00
sheenachhabra
085bc6c416 Upgrade robolectric version to 4.11
Testing details: All tests are passing on github branch as well.

PiperOrigin-RevId: 597529943
2024-01-11 05:47:52 -08:00
ibaker
e54abaa75d Increase minSdk to 19
This is aligned with all other AndroidX libraries, and is required for
us to upgrade to the latest versions of our AndroidX dependencies:
https://android-developers.googleblog.com/2023/10/androidx-minsdkversion-19.html

PiperOrigin-RevId: 596923511
2024-01-09 07:15:21 -08:00
michaelkatz
324e1beef2 Bump media3 version to 1.2.1 and update RELEASENOTES
#minor-release

PiperOrigin-RevId: 596916027
2024-01-09 06:39:56 -08:00
jbibik
3918d36200 Bump media3 versions to 1.2.0 (stable)
#minor-release

PiperOrigin-RevId: 580856330
2023-11-09 04:19:30 -08:00
ibaker
7a10435633 Upgrade Guava dependency to 32.1.3
This is slightly out of sync with the version in AOSP (32.1.2) but the
diff is minimal, and we need 32.1.3 here as it contains the fix for
https://github.com/google/guava/issues/6657.

PiperOrigin-RevId: 578572893
2023-11-01 11:02:35 -07:00
ibaker
e8cca688ad Bump okhttp dependency to 4.12
Issue: androidx/media#768
PiperOrigin-RevId: 577208115
2023-10-27 08:34:19 -07:00
rohks
9d3d7abdc6 Bump Media3 version numbers for 1.2.0-rc01
#minor-release

PiperOrigin-RevId: 575805495
2023-10-23 06:57:55 -07:00
jbibik
97645a200d Bump Media3 version numbers for 1.2.0-beta01 release
#minor-release

PiperOrigin-RevId: 572003628
2023-10-09 12:06:00 -07:00
bachinger
cbd23925d5 Add demos/session-automotive module
This change also enables Android Auto support for the
session demo.

PiperOrigin-RevId: 569448376
2023-09-29 04:00:58 -07:00
bachinger
a3b1661513 Bump Media3 version numbers for 1.2.0-alpha02
PiperOrigin-RevId: 569269992
2023-09-28 13:15:46 -07:00
ibaker
5661794a8f Update external/guava/METADATA link from master to main branch
PiperOrigin-RevId: 566645434
2023-09-19 08:55:48 -07:00
ibaker
2c0d9ba4c3 Rollback of d58f5fdf7d
PiperOrigin-RevId: 566258299
2023-09-18 04:12:21 -07:00
ibaker
d58f5fdf7d Upgrade Guava dependency to 32.1.2
Android's version of Guava was upgraded in http://r.android.com/2731599

PiperOrigin-RevId: 565396612
2023-09-14 09:50:10 -07:00
ibaker
3ced1cbaa2 Update annotation-experimental version
This picks up a fix to ensure Android Studio puts the `@OptIn`
annotation in the correct place:
https://issuetracker.google.com/251172715

This also introduces a transitive dependency from `media3-common` on
the Kotlin standard library, so this CL also includes some updates to
the dev guide to document how apps can avoid including this dep if
they want.

PiperOrigin-RevId: 558821673
2023-08-22 15:40:46 +01:00
jbibik
2156f94480 Bump media3 version to 1.2.0-alpha01 and update RELEASENOTES
#minor-release

PiperOrigin-RevId: 557487465
2023-08-16 21:55:35 +01:00
tianyifeng
1e2a5cd06a Bump version numbers to Media3 1.1.1 and ExoPlayer 2.19.1
PiperOrigin-RevId: 555987303
2023-08-11 20:40:35 +00:00
tonihei
5c5e7cd257 Update storage access in main demo app
The main demo app was still targeting API 29 to avoid scoped storage
restrictions. It is now updated to 34 (like the rest of the demo apps)
and handles scoped storage as it should handle it.

More specifically:
 - We need to request READ_MEDIA_... permissions instead of
   READ_EXTERNAL_STORAGE from API33.
 - The legacy scoped storage opt-out can be removed
 - READ_MEDIA_... permissions don't allow arbitrary file access
   if the file doesn't end in a typical media file extension, so
   this change adds a remark on the guide page to place samples
   in the app-specific directory.
 - We also don't have to request permissions for the app-specific
   directories.
 - Custom json files can't be placed in arbitray local locations
   because they don't end in a media file extension, as there is
   no way we can request a permission to load them. This means we
   can remove the storage request logic in SampleChooserActivity.

Issue: google/ExoPlayer#6045
PiperOrigin-RevId: 549252474
2023-07-20 10:29:02 +01:00
tonihei
2d3f464008 Update demo app target SDKs to 34
This helps to highlight and document new requirements for apps,
e.g. to add the FOREGROUND_SERVICE_MEDIA_PLAYBACK permission for
background playback.

Issue: google/ExoPlayer#11239
PiperOrigin-RevId: 548666056
2023-07-20 10:11:18 +01:00
tofunmi
10cf06386d Fix version bump for media3:1.1.0
#minor-release

PiperOrigin-RevId: 543376501
2023-06-26 09:30:16 +00:00
tofunmi
114364897b Version bump to media3-1.1.0 and exoplayer 2.19.0
#minor-release

PiperOrigin-RevId: 542881427
2023-06-23 16:52:42 +00:00
tonihei
2ac5d8f1af Make FakeClock Espresso and Compose UI test compatible
FakeClock currently doesn't work well with Espresso and Compose UI
tests because view interactions in both frameworks intentionally idle
the main looper to handle pending UI effects. However, this also
advances playback progress even though we want to deterministically
trigger progress from the test itself.

To solve this problem, we can detect the idling Robolectric call and
postpone any further updates until we leave this state.

PiperOrigin-RevId: 541831050
2023-06-20 14:03:06 +01:00
tonihei
51fb72b00d Replace deprecated NullableType from checkerframework with our own one
The existing NullableType has been deprecated 5 years ago and causes
crashes in Kotlin apps because Kotlin doesn't recognize this annotation
as a nullable type annotation.

While we can't align on a single @Nullable annotation yet, we can at
least replace this one by JSR305's @Nonnull(MAYBE) as it fulfils all
requirements, including full Kotlin compatiblity. To avoid the
cumbersome name, we can redefine it as our own @NullableType
annotation. (We can't use @Nullable to avoid name clashes with the main
@Nullable annotation from AndroidX)

Issue: google/ExoPlayer#6792
PiperOrigin-RevId: 540497469
2023-06-19 16:08:20 +01:00
tofunmi
4bceb64dee Version bump to media3:1.1.0-rc01
#minor-release

PiperOrigin-RevId: 539632164
2023-06-12 14:14:33 +00:00
kimvde
04d8edf19e Read Exif orientation data in DataSourceBitmapLoader
PiperOrigin-RevId: 537258424
2023-06-05 09:46:26 +00:00
tofunmi
49ea280bb8 Version bump to media3:1.1.0-beta01
#minor-release

PiperOrigin-RevId: 536464412
2023-05-30 18:48:06 +00:00
ibaker
fe667560d0 Upgrade to Robolectric 4.10.3
We originally upgraded to 4.10 in 889f435a49

However I saw `ShadowActivityThread.reset: ActivityThread not set`
errors when running any Robolectric test, so I downgraded to 4.8.1:
85e449cd87

Nobody else on the team was seeing the same error with 4.10, so it was
something different about my local setup.

The error was actually masking a different problem (see discussion:
https://github.com/robolectric/robolectric/issues/8160). Upgrading to
4.10.1 made the underlying error clear:

```
java.lang.UnsatisfiedLinkError: /tmp/libconscrypt_openjdk_jni-linux-x86_6416831044223480000.so: libstdc++.so.6: cannot open shared object file: No such file or directory
```
This was then fixed by changing my 'Gradle JDK' value in Android Studio
from a JDK 11-based value to a 17-based one. If others see the same
`UnsatisfiedLinkError` when running the tests locally they should check
their Gradle JDK setting in Android Studio.

However there was **another** problem with 4.10 that **did** affect
everyone: some tests in `ExoPlayerTest` would fail with time outs or
assertion failures related to clock advancement.

After some investigation in https://github.com/robolectric/robolectric/issues/8187
it turns out this is because there's lots of unrelease `Player`
instances in `ExoPlayerTest`, which keep lots of active `HandlerThreads`
that then have to all be woken up by Robolectric. 4.10.3 has a fix that
mitigates this, so we can upgrade immediately - but we should also
release all the `Player` instances in `ExoPlayerTest` (it might speed
up test execution too).

PiperOrigin-RevId: 533068395
2023-05-18 12:23:03 +00:00
ibaker
9366b4e50a Rollback of 509830f38f
*** Original commit ***

Rollback of 221a56da38

*** Original commit ***

Rollback of 749d77b1d9

*** Original commit ***

PiperOrigin-RevId: 531530885
2023-05-15 10:41:58 +01:00
tofunmi
8c5e1974f2 Version bump to media3:1.1.0-alpha01
#minor-release

PiperOrigin-RevId: 529735598
2023-05-05 17:00:08 +00:00
ibaker
85e449cd87 Downgrade back to Robolectric 4.8.1
This partially reverts 889f435a49
because our tests fail with 4.10 with an error like:

```
ShadowActivityThread.reset: ActivityThread not set
java.lang.NullPointerException: ShadowActivityThread.reset: ActivityThread not set
	at java.base/java.util.Objects.requireNonNull(Objects.java:246)
	at org.robolectric.shadows.ShadowActivityThread.reset(ShadowActivityThread.java:284)
	at org.robolectric.Shadows.reset(Shadows.java:2665)
	at org.robolectric.android.internal.AndroidTestEnvironment.resetState(AndroidTestEnvironment.java:657)
	at org.robolectric.RobolectricTestRunner.lambda$finallyAfterTest$0(RobolectricTestRunner.java:370)
	at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:86)
	at org.robolectric.RobolectricTestRunner.finallyAfterTest(RobolectricTestRunner.java:368)
	at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$2(SandboxTestRunner.java:298)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:99)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:830)
```

It looks like the code throwing this exception is new in Robolectric
4.10:
65654a76ce

PiperOrigin-RevId: 527290033
2023-04-27 12:26:41 +01:00
tonihei
889f435a49 Update dependencies to latest versions
The only dependencies that are not updated are the ones that need
to be kept in sync with other system (like Android source tree) or
would require a Kotlin dependency in common or exoplayer modules.

As a side effect, some demo apps now need a Kotlin config and some
additional modules require desugaring/multidex logic. To simplify
the setup, the desugaring and multidex steps are added to the common
config.

PiperOrigin-RevId: 527243950
2023-04-26 15:49:57 +01:00