Fix HdmiCecLocalDevice concurrent access
Original implementation of HdmiCecLocalDevice expected only one thread
refers ActionList. The concurrent access causes system_server crash.
To enable for each thread to refer own ActionList without any conflict.
Test: Sanity Test on Android TV connected to AVR.
Repeat screen off and on quickly.
Change-Id: I66f42dfbbd8d193f8a02d3ec5d51783149ddfeb2
This commit is contained in:
committed by
Shuichi Noguchi
parent
4c8fa81d17
commit
c4426af9eb
3
services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
Normal file → Executable file
3
services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
Normal file → Executable file
@@ -660,7 +660,8 @@ abstract class HdmiCecLocalDevice {
|
||||
@ServiceThreadOnly
|
||||
void startQueuedActions() {
|
||||
assertRunOnServiceThread();
|
||||
for (HdmiCecFeatureAction action : mActions) {
|
||||
// Use copied action list in that start() may remove itself.
|
||||
for (HdmiCecFeatureAction action : new ArrayList<>(mActions)) {
|
||||
if (!action.started()) {
|
||||
Slog.i(TAG, "Starting queued action:" + action);
|
||||
action.start();
|
||||
|
||||
Reference in New Issue
Block a user