Monday, 4 March 2019

How does "Phone" app show information of contacts that are not on the address book?

Background

In the "Phone" app of Google, there is an option "Caller ID & spam" :

enter image description here

So, if you get a call from someone that isn't on the address book, yet it is identified somehow, you get a name for it, as such:

enter image description here

Ever since Android M (6.0 - API 23) , apps can replace the default phone app, and then also providing alternative UI when you call someone or get a phone call, by extending InCallService class, as demonstrated here which is based on here.

The problem

I want to try to show the same information as on the Phone app, meaning the name of the person/company in case it identified it (and it's not on the address book).

What I've tried

I tried to dig over the various things that I get via the API of the dialer, but failed:

  1. Various fields and functions of: android.telecom.Call class

  2. There is getDetails inside of the Call class, so I tried to get what's inside there, and there is also statusHints and "label" inside the "statusHints" . None of those had any information (returned null). The reason I tried to look at "statusHints" is because that's what I see on the docs :

Contains status label and icon displayed in the in-call UI.

The questions

  1. Is it possible to get this CallerId information? If so, how?

  2. How does the Phone app do it? It's supposed to be open sourced, so there has to be something that gives it this information, right? Would cloning it somehow get this information? Maybe Google has its own service for CallerID?

  3. What are the "callDetails" and "statusHints" used for? What do they provide?



from How does "Phone" app show information of contacts that are not on the address book?

No comments:

Post a Comment