OSDN Git Service

Fix tracking of hardware state for dump
authorGlenn Kasten <gkasten@google.com>
Thu, 2 Feb 2012 22:16:03 +0000 (14:16 -0800)
committerGlenn Kasten <gkasten@google.com>
Fri, 24 Feb 2012 21:31:26 +0000 (13:31 -0800)
commit8abf44d2f2bcd20a2835570efe89d89c19db426a
tree29fc684b04d18621913145c807c4493f5b607d86
parentd6fd85a157ce2054b2304e6d171fa87ae09c363d
Fix tracking of hardware state for dump

At end of AudioFlinger::onFirstRef(), the hardware status was being left
in wrong state.  It should be AUDIO_HW_IDLE but was AUDIO_HW_INIT.

mHardwareStatus was being set to AUDIO_HW_OUTPUT_OPEN too early, and so
a return would leave it in the wrong state until next hardware operation.

Take the hardware lock for dev->get_parameters, and update mHardwareStatus
before and after.

Keep hardware lock only for the duration of the dev->set_parameters.

Rename two constants in enum hardware_call_state to have the prefix
AUDIO_HW so they follow the naming conventions.

Add comments.

Change-Id: I6c7450b11f9b13adaeef9cec874333e478a58fc0
services/audioflinger/AudioFlinger.cpp
services/audioflinger/AudioFlinger.h