AudioSystem: new service cache reduces ANRs and improves performance.
Reduced ANRs: 1) Do not block on AudioFlinger or AudioPolicy for more than 10 seconds to prevent ANRs. Audioserver failure is returned to the AudioService which can be ignored as the ground truth is stored in AudioService and audioserver is currently dead. 2) Always check for audio services upon each thread request to avoid ServiceManager notification failure when ThreadPool is locked up. Improved performance: 1) Trigger actions based on binder driver death notifications and ServiceManager service notifications, saves about 300ms on Track restore. 2) Single notification handling is shared among all clients. Flag: EXEMPT bugfix Test: instrumented audioserver delay, audio setting responsiveness Test: instrumented audioserver delay, avoid ANR (see bug). Test: hotword service works Test: atest powerstats_collector_tests Bug: 372348587 Change-Id: Ifd5b5457f4ca181ed30b6aea7ed4effad7aebef5
Loading