Fix raciness in AudioServiceListener
This fixes potential race conditions in AudioServiceListener resulting from the fact that a service instance can become unreachable (and may therefore be replaced with a new one) before it is officially designated as "stopped" by the Service Manager, even in the case of singleton services. The ServiceManagerListener API is augmented to convey a service instance's current running state via RunningServiceInfo. This is used by AudioServiceListener to more accurately track the running audio service instance. The listener now tracks the Identity of the most recently created audio service instance and responds to events accordingly. This also updates the logic and comments in resource_coordinator's ProcessMap to accurately reflect current guarantees of the ServiceManagerListener API, since these have changed slightly. NOTRY=true Bug: 818593,907898,908319 Change-Id: If3e8a35aa90db72a34c8f5f2d458f0f24c3447eb Reviewed-on: https://chromium-review.googlesource.com/c/1350649 Commit-Queue: Ken Rockot <rockot@google.com> Reviewed-by:Olga Sharonova <olka@chromium.org> Reviewed-by:
Tom Sepez <tsepez@chromium.org> Reviewed-by:
oysteine <oysteine@chromium.org> Cr-Commit-Position: refs/heads/master@{#611193}
Showing
Please register or sign in to comment