Android 1.6 equivalent of EXTRA_GATEWAY_URI
Asked Answered
Q

2

8

I want to implement a gateway for handling outgoing calls.

In the latest Android versions 2.x I can do this easily with the hidden ACTION_CALL extra string: "com.android.phone.extra.GATEWAY_URI"

But in earlier versions, like 1.6, I don't know how to do it. It must be possible because Google Voice is doing it. Can someone please help me?

Thanks, Emmanuel

Quackenbush answered 2/11, 2010 at 20:10 Comment(4)
Basically I want to be able to call a phone number, but have a different number be displayed for the user. This would be useful for calling-card applications for example.Quackenbush
What do I have to do to get this answered?Quackenbush
Isn't the original code open sourced somewhere. You can simple scan the implementation and copy the needed code.Bridgid
Does google voice actually dial calls? I thought it used the IP network to ask the server place a call, and then answered the callback just more seamlessly than when you do it from the website. If you compare your google voice "dialed" log to your mobile bill (assuming it specifies incoming/outgoing) you should be able to tell if this is the case.Manger
A
2

Hey Emmanuel, 76% of Devices already run Android 2.x maybe that effort is wasted. Gingerbread is expected to come out by the end of the year, which will push the percentage of 1.6 Devices further down. In less than half a year Android 2.x and higher will by beyond the 80% mark. Just look at the Platform version distribution http://d.android.com/resources/dashboard/platform-versions.html. Maybe have a look at the source code in the Android Open Source Project.

I found the string you mentioned in the InCallScreen.java. Maybe that gives you a way to dig into the older source code to try to figure out if you can access it through some undocumented APIs. But my suggestion would be to not bother with those last 25% of 1.6 devices they will disappear fast.

[Update] Since it is a requirement to make it work, I would suggest you recompile the Phone App from the git repository and make it debugable that way you can see exactly what is going on. Probably having an ASOP Device running 1.6 would be your best bet to drill deep into how Android is doing it. Basically you would have to back port all the code that is involved in this feature in 2.x back to 1.6. From a time to market perspective I would suggest get the app out with 2.x support and release a second version that is tailored for 1.6. Delaying the release just because of 1.6 seems to be a bad business idea.

Alysa answered 15/11, 2010 at 17:34 Comment(3)
In a sense I agree with you but this is a requirement from my employer and I have to deliver. I did look into the older code but I don't know how it works. I've tried playing with the extras with no success. Basically I want to be able to call a phone number, but have a different number be displayed for the user.Quackenbush
I'm nos sure I understand. You want me to debug the Phone App while running Google Voice? I'm not sure how to do that... First I have to install Google Voice on the emulator--no idea how to do that. Second Google Voice is not available in Canada. I'd have to cheat.Quackenbush
Hey Emmanuel, no I am not saying debug Google Voice but the Phone app from 2.x so you can see where and how the Phone App uses the method and then you can drill all the way down into the low level calls within Android and hopefully find something that has already existed in 1.6 It is tedious but if you really need to figure it out that is the only way I could imagine. You can debug it either on the Emulator or a real phone. But recompiling the Phone app will be necessary since the stock app is usually not debuggable.Alysa
J
0

That code using the GATEWAY_URI was definitely added in Eclair. Looking into AOSP, in packages/apps/Phone/src/com/android/phone/InCallScreen.java, that bit of code is completely inexistant in Donut :

    // If a provider is used, extract the info to build the
    // overlay and route the call.  The overlay will be
    // displayed the first time updateScreen is called.
    if (PhoneUtils.hasPhoneProviderExtras(intent)) {
        mProviderLabel = PhoneUtils.getProviderLabel(this, intent);
        mProviderIcon = PhoneUtils.getProviderIcon(this, intent);
        mProviderGatewayUri = PhoneUtils.getProviderGatewayUri(intent);
        mProviderAddress = PhoneUtils.formatProviderUri(mProviderGatewayUri);
        mProviderOverlayVisible = true;

        if (TextUtils.isEmpty(mProviderLabel) || null == mProviderIcon ||
            null == mProviderGatewayUri || TextUtils.isEmpty(mProviderAddress)) {
            clearProvider();
        }
    } else {
        clearProvider();
    }

I cannot see any alternative. You're best luck maybe to take that Phone application from Donut, add what you need and release it as a new Phone application on Donut devices...

Jitney answered 18/11, 2010 at 1:8 Comment(1)
I was also looking in the source code and I did notice that the API was missing in 1.6 and previous. But since Google Voice can do it, there has to be some other API that I can use to produce similar results. I looked at extras but couldn't find anything. I find it weird that for ACTION_CALL the phone number is specified in both EXTRA_PHONE_NUMBER and in the intent URI but only the intent URI number seems to matter. Whatever I put in EXTRA_PHONE_NUMBER seems to be ignored. Or maybe there's a secret action to make Google Voice calls?Quackenbush

© 2022 - 2024 — McMap. All rights reserved.