OSDN Git Service

Avoid race condition when broadcasting device list changed.
authorjiabin <jiabin@google.com>
Tue, 22 May 2018 22:44:21 +0000 (15:44 -0700)
committerjiabin <jiabin@google.com>
Wed, 23 May 2018 00:56:09 +0000 (17:56 -0700)
commit8c3a767b2dea8cc8fa75f39c600252e3cd1f76e9
tree1b6f20f4198c7e785157f2d53b9e34933f0d2c81
parent8dd9ef190bf580fae6aa8e850f60985458b70c21
Avoid race condition when broadcasting device list changed.

Since broadcastDeviceListChanged could be called in different threads,
there would be race condition causing mutilple callback due to
mPreviousPorts is not thread safe.

Bug: 80138804
Test: run TestDeviceList app in toolbox and cts
Change-Id: I0aa70dc45594bca263ea6f36703f22fe0293f679
media/java/android/media/AudioManager.java