0

By going through the code of vold,

I found there are a couple of lines of code in main.cpp (system/vold/main.cpp) that I dont get the real function of these.

Those are..

1.

vm->setBroadcaster((SocketListener *) cl);

nm->setBroadcaster((SocketListener *) cl);

2.

coldboot("/sys/block");

Why vold does a coldboot here?


Could anyone explain a bit about why vold does this?

Thanks

Sam
  • 4,521
  • 13
  • 46
  • 81

2 Answers2

1

THe coldboot is done for coldplug devices by sending "add" to uevent files in /sys/block tree.

As described in uevent sent from kernel to user space (udev)

Community
  • 1
  • 1
0

I think I've found out the answer for the first question.

vm->setBroadcaster((SocketListener *) cl);

nm->setBroadcaster((SocketListener *) cl);

In this case, VolumeManager and NetlinkManager need to send the notify to MountService which is in framework layer. Hence, CommandListener acts as a broadcaster for vm and nm. : )

Sam
  • 4,521
  • 13
  • 46
  • 81