Question

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

Était-ce utile?

La solution 2

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. : )

Autres conseils

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)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top