Fix AudioRouter logic outside of a phone call.

We weren't doing the correct logic within AudioRouter when no phone
call was present. This change updates onWiredHeadsetConnected() function
to do the right thing when no phone calls are in place.

Also added some more logging and consolidated some code into functions
to increase readbility of setAudioMode() function.

This looks like more change that it is, but to be sure, I tested all
code paths created with this change with and without a phone call (where
possible...no way to set speakerphone outside of phone call).

bug:10932676
Change-Id: Ibd98363010085a803e5abc2b67dec796e2bbb744
1 file changed