6

I'm writing a custom Android contacts directory, I have implemented the ContactsContract.Directory provider and the search from within the phone app works fine.

The problem I am facing now is that when I have an incoming/outgoing call the Android dialer does not query the custom directory I registered. Is it possible to partake in caller ID resolution via PhoneLookup or some other way?

Also as a possible workaround I have tried implementing an outgoing/incoming call interceptor with BroadcastReceiver but I see no way of returning the contact data to the dialer. The only option I have found for displaying the data is to overlay a transparent activity over the native dialer. Is there a way to return contact data back to the dialer that sent the broadcast? Any other ideas I could try?

PS. Google uses the functionality I'm trying to implement for nearby places directory listings and Caller ID by Google.

PPS. By reading the ContactsContract implementation of PhoneLookup I stumbled upon corporate contacts directory that can be appended to the user profile's default directory, according to the code it should get queried for PhoneLookup, so I'm going to try that on Monday.

mangefort
  • 353
  • 1
  • 2
  • 9
  • Hi did you have any success with this? I need to do the same but would rather not user an overlay if possible – Chris.D Aug 16 '16 at 15:48
  • Unfortunately no, it seems that the only way to do this is to write a custom dialer, I ended up using an overlay. – mangefort Aug 17 '16 at 19:31
  • Hi, would you share how exactly you implemented the ContactsContract.Directory? – dephinera Jan 25 '17 at 14:22
  • Please refer to http://www.programcreek.com/java-api-examples/index.php?api=android.provider.ContactsContract.Directory there are also numerous other examples. – mangefort Jan 26 '17 at 17:31
  • Any new about this? I have same problem, on emulator on incoming call phone lookup searches my custom directory but on real device its not working. – patonjo May 22 '19 at 21:14
  • Check out my answer here: [Provide the caller id for incoming call from my own app](https://stackoverflow.com/questions/48870782/provide-the-caller-id-for-incoming-call-from-my-own-app/57733654#57733654) – Jacob Michaelis Sep 04 '19 at 14:34

0 Answers0