HFP AG: Track the current state machine state

When state machine moves from one state to
another and getCurrentState API is called
from a different thread, the API may throw
an exception - 'arrayoutofboundsexception'.

Maintaining the current state and getting/
setting the state in synchronized way will
avoid the issue.

CRs-Fixed: 2295514
Change-Id: If9ca22364483b6812fcb78fff46e37e979ea6eca
1 file changed