+61
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
This change refactors `Ringer.java` to replace its internal `Handler` and `HandlerThread` with a `java.util.concurrent.ExecutorService` (specifically, a single-thread executor). This aligns with the recommended practice of using the `java.util.concurrent` framework for asynchronous operations in Mainline modules. Key modifications include: - Replaced `Ringer.mHandler` and its associated `HandlerThread` with `mRingerExecutor` (an `ExecutorService`). - Calls to `handler.post()` are now `executor.execute()`. - Introduced `LoggedExecutor` to adapt the existing session-based logging mechanism (previously in `LoggedHandlerExecutor`) to the new `ExecutorService`, preserving detailed logging capabilities. - Added `Ringer.shutdownExecutor()` for proper lifecycle management of the `ExecutorService`. This refactoring improves the stability, reduces platform coupling, and enhances the Mainline compatibility of the Ringer component. Flag: com.android.server.telecom.flags.resolve_hidden_dependencies_two Bug: 308452386 Test: atest com.android.server.telecom.tests.RingerTest Change-Id: I3abd109eee162fe767761650fedcbf8687a54ee9