Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Phone app labels outgoing calls to businesses with the business name; can BCR do the same? #291

Closed
blackwind opened this issue Apr 13, 2023 · 15 comments · Fixed by #298
Assignees
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project

Comments

@blackwind
Copy link

To my surprise and delight, every single business number I've manually dialed since moving from VoIP to a cell plan has been correctly identified and labelled by Google Phone in my call logs. Is there a way to obtain this information through the telephony framework and apply it to ${caller_name} when empty, or is this a Phone-exclusive feature with no retrieval interface?

@chenxiaolong
Copy link
Owner

this a Phone-exclusive feature with no retrieval interface?

This is unfortunately the case. The online lookup process is done entirely within Google Dialer and it doesn't provide that information back to the telephony framework or anywhere else.

@chenxiaolong chenxiaolong self-assigned this Apr 13, 2023
@chenxiaolong chenxiaolong added the bug/limitation elsewhere Bug/limitation in the ROM or another project label Apr 13, 2023
@blackwind
Copy link
Author

It seems that's not entirely true. I downloaded another dialer, and after granting call log access, I'm seeing the same business names Google Phone identified that shouldn't otherwise be there. If the call log can be queried by number (or iterated through until you find a match), that's the path forward should you choose to follow it. I feel like significantly improving filename discovery is a worthwhile pursuit, but would also respect KISS if cited.

@chenxiaolong
Copy link
Owner

Hmm, I didn't think to go at it via the call log API. I'm not very familiar with it, but I wonder if it allows dialer apps to put whatever information they want in it. I'll investigate.

Which third party dialer did you use for testing?

@blackwind
Copy link
Author

Simple Dialer does the trick.

@chenxiaolong
Copy link
Owner

Thanks! Looks like CACHED_NAME is the call log field that Simple Dialer displays for the name and sure enough, AOSP dialer has some code for updating that, so I assume Google Dialer does too.

I'm going to finish tackling #288 before coming back to this. If the call log is updated by the time the call reaches the DISCONNECTING state, then I'm definitely happy to add this. But if it requires waiting for the call log to update, then I probably won't because the recording process is too closely tied to the lifecycle of the call.

@chenxiaolong
Copy link
Owner

chenxiaolong commented Apr 17, 2023

Do you happen to have a test number that I can try calling to trigger Google Dialer's business lookup feature? (I can call numbers in the US or Canada. EDIT: Oops, turns out my plan does not allow calling Canada numbers.)

I've tried calling a few random ISP's customer service numbers and even if they trigger the fancy Google Assistant speech recognition thing, the call log only shows the phone number.

@blackwind
Copy link
Author

Anything you can look up in Google Maps should work. Here's one that just worked for me: 204-269-6548. Note that you need to have the associated option enabled in Phone.

@blackwind
Copy link
Author

Oh, just saw your edit. I can't call US numbers to confirm, so, Google Maps it is.

@chenxiaolong
Copy link
Owner

Thanks! Any chance you know what the option is?

I looked through my call history for something with a business name, called it again, and the new call log entry only has a phone number.

@blackwind
Copy link
Author

Settings > Caller ID & spam > See caller and spam ID

@chenxiaolong
Copy link
Owner

Hmm, I already have that enabled. Doesn't seem to work on VoWIFI or cellular.

@blackwind
Copy link
Author

Bizarre. I just turned it off, tried another grocery store, and it didn't identify it.

@chenxiaolong
Copy link
Owner

chenxiaolong commented Apr 17, 2023

Gah, Google must've pushed out a bad update or something. I uninstalled Google Dialer updates and it's working. Installed the update again and it broke.

EDOT: Broken version for me is 101.0.522170771-pixel2022

@chenxiaolong
Copy link
Owner

Well anyway, I have enough logs from a few test calls with the old Google Dialer. It looks like Google Dialer takes anywhere from 100ms to 1200ms to update the call log after the call enters the DISCONNECTED state. The new busted Google Dialer still updates the call log, but the name is set to an empty string.

I'm going to make BCR poll every 100ms for up to 2s after the call completes to get the call log name, but only if {call_log_name} is in the template and its value must be computed. Crappy solution, but seems to work well enough.

chenxiaolong added a commit that referenced this issue Apr 17, 2023
This commit adds a new `{call_log_name}` variable that can be used in
the filename template for including the call log cached name. The cache
name may be updated by the system dialer to include the name of the
business assocciated with the phone number.

This new variable is added to the default filename template, but only as
a last resort because it relies on polling for up to 2 seconds after the
call completes.

Fixes: #291

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Apr 17, 2023
This commit adds a new `{call_log_name}` variable that can be used in
the filename template for including the call log cached name. The cache
name may be updated by the system dialer to include the name of the
business assocciated with the phone number.

This new variable is added to the default filename template, but only as
a last resort because it relies on polling for up to 2 seconds after the
call completes.

Fixes: #291

Signed-off-by: Andrew Gunnerson <[email protected]>
@blackwind
Copy link
Author

Beautiful. This next release is gonna be lit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants