Car Dock
Hi Codeworkx
I have today received an Official Samsung SII Car Dock.
The dock has 1 USB connector (that goes into the phone) that is then split out into a USB power input and a Audio Jack input.
Currently the Audio Jack does not work. The expected behaviour is that the AudioService class should get an appropriate intent when it senses the Audio connection being connected.
Code:
private class AudioServiceBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
I have added some extra logging into the AudioService.java and while connected to adb via wireless, plugged in the dock.
I do get this intent (ACTION_DOCK_EVENT)
Code:
V/AudioService( 2028): Broadcast Receiver: Got action = android.intent.action.DOCK_EVENT
V/AudioService( 2028): Broadcast Receiver: Got ACTION_DOCK_EVENT, dockState = 2
The Extra dock state is
Intent.EXTRA_DOCK_STATE_CAR which is right - infact on the device I can see the dock Icon.
However the current code in that block sets the Audio to be the BT Car Dock.
I had hoped that this may be the reason why I was getting no audio - so I changed the default to the USB Analog Dock
Code:
//config = AudioSystem.FORCE_BT_CAR_DOCK;
config = AudioSystem.FORCE_ANALOG_DOCK;
This didn't seem to work either, so I noticed that the config for the force is actualy set for each type - so I added the following after the AudioSystem.FOR_DOCK
Code:
AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, config);
Again this did not work.
So I had an Idea - the dock event is not the same as an audio plug even - when I pug into the normal audio jack I get a new Intent (for the top jack).
I dont get anything for the dock audio.
Further down the same class I see the following
Code:
} else if (action.equals(Intent.ACTION_USB_ANLG_HEADSET_PLUG)) {
int state = intent.getIntExtra("state", 0);
Log.v(TAG, "Broadcast Receiver: Got ACTION_USB_ANLG_HEADSET_PLUG, state = "+state);
synchronized (mConnectedDevices) {
This seems to be what I am looking for.
So what is stopping the intent event being fired?
Is there something missing from the Kernel to support the USB Analog Headset?
My Java debugging is pretty good, but my lack of Kernel & Android experience is stopping me get any further.
Thanks
Steven