Skip to content
Commit 2ab3cc24 authored by Jeff Blattman's avatar Jeff Blattman Committed by Julia Reynolds
Browse files

Use a concurrent hash map to access VolumeDialogControllerImpl's callbacks

The issue is that the VolumeDialogControllerImpl.C's mCallbackMap is
accessed from two different threads. Instrumentation shows that via
add() and remove() it is modified on the main thread, and methods like
C.onConfigurationChanged() are called from
VolumeDialogControllerImpl.Receiver, which registers with
on a handler tied to a background thread
(VolumeDialogControllerImpl.W/mWorker). C.onConfigurationChanged()
is called directly from that thread.

Use a concurrent hash map in place of hash map to avoid the
concurrent modification exception.

Test: manual. Ensure device boots. Ensure basic volume control
functions. Ensure a configuration change (via locale change)
does not result in any crash.

Bug: https://issuetracker.google.com/issues/150402778

Change-Id: I26bb8533c30d57e48f500e6863d0f522e1559567
parent 68ca4e10
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment