Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 815600d8 authored by Kshitij Gupta's avatar Kshitij Gupta
Browse files

Media3ActionFactory: Drop usages of runBlocking

- This CL refactors Media3ActionFactory to remove blocking runBlocking
  calls, leveraging asynchronous coroutines for Media3 operations.
- Previous use of runBlocking in getMedia3Actions for Media3 controller
  interactions could block the calling thread, potentially causing UI
  jank or ANRs.
- getMedia3Actions is now a suspend fun, allowing its callers to suspend
  instead of blocking. Custom actions are fetched and mapped
  asynchronously
- The suspendCancellableCoroutine block for createMediaAction now
  directly launches a coroutine on bgScope, removing reliance on
  Handler.post for dispatching controller calls, for structured
  concurrency and cancellation.

Bug: 423462317
Flag: com.android.systemui.do_not_use_run_blocking
Test: atest Media3ActionFactoryTest
Change-Id: Ie9adcb5cd8caaaf0a42c7400e890f5bfcd26dc4c
parent 8a9ab13d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment