Whatsapp provides a hidden feature to the message, voice call or video call any registered user who is also in your contacts list. See the attached image. These options are available on different contacts app as well, so it not the contacts app which is doing the job.
Now after some researching, I have some faint idea about how they are doing it. These apps(WhatsApp, truecaller, paytm etc) are creating their own contacts and other contacts app is simply looking for contact providers and showing all the available options for any particular contact.
I am looking for some reference material or guide to achieve the same. Thanks.
Whatsapp functions within other contacts apps
You need an Contacts account, a SyncAdapter, and to add custom RawContacts with custom mimetype (for each action) for all contacts you want to add actions to.
See this: https://stackoverflow.com/a/42642971/819355 And this: https://stackoverflow.com/a/42005334/819355