media/libraries
tianyifeng 0143884cd7 Deflake the DefaultPreloadManagerTest
From [ the last change in `DefaultPreloadManagerTest`](2b54b1ebbe), the preloadManager began to use a separate `preloadThread` in `release_returnZeroCount_sourcesAndRendererCapabilitiesListReleased`, which unveils a bug in `PreloadMediaSource`. When `PreloadMediaSource.releasePreloadMediaSource` is called, `preloadHandler` will post a `Runnable` on the preload looper to release the internal resources. Before this `Runnable` is executed, it is possible that the [`stopPreloading`](https://github.com/androidx/media/blob/main/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/source/preload/PreloadMediaSource.java#L442) method is executed just as the result of preloading has completed. This is expected to remove the posted `Runnable`s for further preloading, however, the posted `Runnable` for releasing will also be removed from the message queue.

Ideally we should use `postDelayed(runnable, token, delayMillis)` to post the runnables so that the token will be useful to identify which messages to remove in `removeCallbacksAndMessages(token)`, but that `postDelayed` method is only available from API 28. So in this change we are using a separate handler for releasing, and then the call of `preloadHandler.removeCallbacksAndMessages` won't impact the runnable for releasing.

#cherrypick

PiperOrigin-RevId: 696894483
2024-11-15 08:22:54 -08:00
..
cast Remove @DoNotInline annotations 2024-09-18 04:47:39 -07:00
common Merge pull request #1265 from DolbyLaboratories:dlb/ac4-level4/dev_new2 2024-11-13 09:08:22 -08:00
common_ktx Add jvmTarget and kotlin-android plugin to common_ktx module 2024-08-15 10:36:10 -07:00
container Add support to ApvC codec in Mp4Extractor 2024-11-12 11:59:56 -08:00
database Enable lint in tests for modules that require no fixes 2024-11-05 05:40:03 -08:00
datasource Enable lint in tests for modules that require no fixes 2024-11-05 05:40:03 -08:00
datasource_cronet DataSourceContractTest: Tighten assertions around 'not found' URIs 2024-10-24 03:49:27 -07:00
datasource_okhttp DataSourceContractTest: Tighten assertions around 'not found' URIs 2024-10-24 03:49:27 -07:00
datasource_rtmp Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
decoder MediaCodecVideoRenderer skips decoder inputs unused as reference 2024-07-09 03:43:06 -07:00
decoder_av1 Add missing DefaultRenderersFactoryTest for decoder extensions 2024-10-30 05:33:38 -07:00
decoder_ffmpeg Add 16 KB page support for decoder extensions on Android 15 2024-10-10 10:18:20 -07:00
decoder_flac Set container MIME type for audio-only extractors 2024-11-14 10:03:17 -08:00
decoder_iamf Enable lint in tests for modules that require no fixes 2024-11-05 05:40:03 -08:00
decoder_midi Set container MIME type for audio-only extractors 2024-11-14 10:03:17 -08:00
decoder_mpegh Merge Issue: androidx/media#1826: add extension for MPEG-H decoding 2024-10-24 09:53:45 -07:00
decoder_opus Refactor OpusDecoderTest to use OpusLibrary.isAvailable() 2024-10-30 10:02:46 -07:00
decoder_vp9 Add 16 KB page support for decoder extensions on Android 15 2024-10-10 10:18:20 -07:00
effect Rename signalEndOfInputStream() 2024-11-11 07:44:15 -08:00
exoplayer Deflake the DefaultPreloadManagerTest 2024-11-15 08:22:54 -08:00
exoplayer_dash Add TestPlayerRunHelper run(player).untilFullyBuffered 2024-11-06 02:45:51 -08:00
exoplayer_hls Parse interstitials into HLS media playlist 2024-11-14 03:09:12 -08:00
exoplayer_ima Add handleContentTimelineChanged to AdsLoader 2024-11-15 07:49:41 -08:00
exoplayer_rtsp Enable lint in tests for modules that require no fixes 2024-11-05 05:40:03 -08:00
exoplayer_smoothstreaming Fix empty LoadEventInfo.uri passed to onLoadStarted 2024-10-30 15:52:48 -07:00
exoplayer_workmanager Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
extractor Set container MIME type for extractors in ts module 2024-11-15 07:37:43 -08:00
muxer Enable lint in tests for modules that require no fixes 2024-11-05 05:40:03 -08:00
session Enable lint in tests for modules that require no fixes 2024-11-05 05:40:03 -08:00
test_data Set container MIME type for extractors in ts module 2024-11-15 07:37:43 -08:00
test_exoplayer_playback Enable lint in tests for modules that require no fixes 2024-11-05 05:40:03 -08:00
test_session_common Add media button preferences 2024-10-17 09:54:36 -07:00
test_session_current Fix supportedCommands in MediaMetadata 2024-11-11 06:07:02 -08:00
test_utils DecodeOneFrameUtil: do not access release players 2024-10-29 03:48:29 -07:00
test_utils_robolectric Add TestPlayerRunHelper run(player).untilFullyBuffered 2024-11-06 02:45:51 -08:00
transformer Implement video effects for Frame Extraction 2024-11-15 06:09:55 -08:00
ui Change lib-common dependency scope to api in lib-ui 2024-11-06 08:21:16 -08:00
ui_compose Enable lint in tests for modules that require no fixes 2024-11-05 05:40:03 -08:00
ui_leanback Bump effect and leanback minSdk to 19 2024-01-10 07:22:00 -08:00
lint.xml Enable lint in lib-common tests 2024-11-04 04:16:39 -08:00