4

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?

3
  • Something like this and this? Functional docks connect through USB or pogo pins (rarely seen now) and may transmit audio/video alongside charging.
    – Andy Yan
    Nov 8 '16 at 4:00
  • Hmm, interesting... so how does the phone know if it's in a dock? Also - my understanding is that Android doesn't officially support audio over USB - are all docks specific to certain brands of phones, and up to the whims of the manufacturer to add features?
    – Josh
    Nov 9 '16 at 6:35
  • The pogo-pin docks certainly are phone-specific. I bet there are chips inside them that, when connected with the phone, communicate through some of the pins. But since I never had the chance to own a phone with that kind of dock back then I couldn't verify...
    – Andy Yan
    Nov 9 '16 at 9:35
2
+50

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:

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 -> microcontroller] -> USB -> [device driver -> kernel -> event/state file -> dock observer -> apps]


Additional references:

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.