What is an Android dock? When is a phone considered "docked"? In Android's "daydream" settings, you can set "When to daydream" to "While docked" or "While charging." What does "Docked" mean? The only products I've seen that are sold as android "docks" are just stands that are shaped to prop up the phone at an aesthetically pleasing angle while charging - the phone doesn't know if it's in such a stand, though. I haven't found an Android equivalent of the music-playing docks that the iPhone can connect to.

The developer documentation describes 4 types of docks: Car, Desk, Low-End (Analog), and High-End (Digital). (The documentation implies that #3 and #4 are subtypes of #2.)

So, what is a dock? How does the phone decide if it's plugged into one, and which kind it is? What can docks do - play music? Can they do other things? Is there some sort of open standard defining how an Android phone talks to a dock (if that's even possible)? Can anyone point to example products representing each type of dock?
Preface: I am not an expert in the kernel and hardware driver-related topics. This answer is based only on finding and my limited understanding. I possibly use many wrong terms since I am not really familiar with them.


What is a dock?

A docking station is a device that is capable to communicate with the Android kernel to fire docking-related events and/or modify the docking file state.

How does the phone decide if it's plugged into one, and which kind it is?

The Android system is observing the docking-related events and the docking file state. When a device is docked, the kernel driver fires an event or modifies the file state, which make the Android system notice it, then it will broadcast the event to the apps system-wide.
The docking mode may depend on how the kernel is programmed, for example:

Using a single state file with multiple values (e.g. 0: undocked, 1: desk, 2: car)
Using multiple state files (e.g. /whisper/state for car dock, /smartdock/state for multimedia dock)


What can docks do - play music? Can they do other things?

A docking station can make the system and apps do anything that is programmed. One example is showing a different layout on docked state. It may also open a music player app and play music automatically on desk mode if it is programmed as such, or open a map/navigation app on car mode, etc.

Is there some sort of open standard defining how an Android phone talks to a dock (if that's even possible)?

The standard is mostly based on Linux kernel driver using uevent (event-based) and state file (polling) as previously mentioned. However, the responsible kernel and Android code can be customized, also as previously mentioned.

To put simply:
[Docking station -&gt; microcontroller] -&gt; USB -&gt; [device driver -&gt; kernel -&gt; event/state file -&gt; dock observer -&gt; apps]

Additional references:

Kernel source code for a dock driver

Another kernel source code for hardware consumer? (HWC)

GitHub - slayher/CM7_Mecha_issue - Does not switch to desktop dock mode

Unix &amp; Linux Stack Exchange - What is the difference between kernel drivers and kernel modules?