I'm creating a ContactsContrat.Directory in my android app. That I want to do is: In incoming/outgoing call, the Android dialer do a query to my custom directory that I've registered.
This is the resource that I've read to do it: https://developer.android.com/reference/android/provider/ContactsContract.Directory.html
This is my code in the AndroidManifest:
<provider
android:name=".CustomContactProvider"
android:authorities="com.myapp.CustomContactProvider"
android:enabled="true"
android:exported="true"
android:grantUriPermissions="true"
android:multiprocess="true"
android:readPermission="android.permission.READ_CONTACTS"
android:writePermission="android.permission.WRITE_CONTACTS">
<meta-data
android:name="android.content.ContactDirectory"
android:value="true" />
</provider>
According with the android developer resource
"Custom Directories are discovered by the Contacts Provider following this procedure: It finds all installed content providers with meta data identifying them as directory providers in AndroidManifest.xml: This tag should be placed inside the corresponding content provider declaration."
with the meta-data should be working and do a call to my custom provider every time that the Contacts Provider is call it, but it doesn't work when I do a call or I open the contacts in my phone.
Any suggestion or idea of how to can do this?