[Android Q&A, Help & Troubleshooting] eL_Jee:
Recently I bought a car navigation system based on Gingerbread.

The android part runs on a detachable tablet, very much like the Erisin ES777A.

The tablet has some functionality I don't like:

- when docked it starts playing music

- when I stop my car's engine the android device shuts down. Apparently there's also a small voltage drop when I start my car - it also shuts down upon starting my engine.

I would like to be able to disable this functionality and start my own programs using Tasker.

After some digging I found that the tablet actually doesn't use the android docking mode, but rather watches a connected earphone.

From dmesg I found for disconnecting / connecting the headphone (docking/undocking)

<4>[ 757.400000] HW switch gpio(earphone detect pin) change 0->1
<4>[ 781.050000] HW switch gpio(earphone detect pin) change 1->0

Logcat, connecting the headphone:

V/HeadsetObserver( 946): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=2, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=876, ACTION=change, SWITCH_NAME=h2w}
V/HeadsetObserver( 946): Intent.ACTION_HEADSET_PLUG: state: 1 name: h2w mic: 0
I/WindowManager( 946): KEYCODE_FUNCTION_F11 system stay awake :
I/WindowManager( 946): KEYCODE_FUNCTION_F11 system stay awake :

Logcat, disconnecting the headphone:

V/HeadsetObserver( 946): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=0, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=869, ACTION=change, SWITCH_NAME=h2w}
I/PlayerService( 1181): ACTION_API_COMMAND cmd=2
I/AudioService( 946): Remote Control registerMediaButtonEventReceiver() for ComponentInfo{com.android.music/com.android.music.MediaButtonIntentReceiver}

Turning on the engine / power gives in logcat:

D/WifiService( 946): ACTION_BATTERY_CHANGED pluggedType: 1
V/HeadsetObserver( 946): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=2, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=872, ACTION=change, SWITCH_NAME=h2w}
W/Vold ( 876): Ignoring unknown switch 'h2w'
V/HeadsetObserver( 946): Intent.ACTION_HEADSET_PLUG: state: 1 name: h2w mic: 0
W/DvcNeonEqualizer( 1181): Starting fixed point NEON optimized equalizer with DVC
I/AudioService( 946): Remote Control registerMediaButtonEventReceiver() for ComponentInfo{com.maxmpz.audioplayer/com.maxmpz.audioplayer.player.PlayerMediaButtonReceiver}
D/dalvikvm( 1181): GC_EXPLICIT freed 43K, 49% free 3606K/6983K, external 1249K/1761K, paused 36ms
I/PlayerService( 1181): ACTION_API_COMMAND cmd=3

Turning off the engine / power gives in logcat:

D/WifiService( 946): ACTION_BATTERY_CHANGED pluggedType: 0
I/WindowManager( 946): KEYCODE_FUNCTION_F8 down turn off system :
W/WindowManager( 946): Unable to find ITelephony interface.
D/ShutdownThread( 946): Notifying thread to start radio shutdown
I/ShutdownThread( 946): Sending shutdown broadcast...
W/SyncManager( 946): Writing sync state before shutdown...
I/WindowManager( 946): KEYCODE_FUNCTION_F8 up :
E/audioplayer.Application( 1181): ACTION_SHUTDOWN
I/WindowManager( 946): KEYCODE_FUNCTION_F8 down turn off system :
W/WindowManager( 946): Unable to find ITelephony interface.
I/WindowManager( 946): KEYCODE_FUNCTION_F8 up
........

That's about where my diagnostic skills end. I am rooted so I should be able to manipulate the /system to my needs.

Any thoughts on how to proceed to identify the process responsible for performing these actions?