开发者

How to hang up (disconnect, terminate,..) incomings call?

开发者 https://www.devze.com 2022-12-28 18:57 出处:网络
\"How do you hang up incoming calls (in Android of course)?\" First, I know this question has been asked and answered several times, and the response is always \"you can\'t\". But if we look in the m

"How do you hang up incoming calls (in Android of course)?"

First, I know this question has been asked and answered several times, and the response is always "you can't". But if we look in the market we get a few applications (all private software, no access to the source code... :-( ) that do this action, such as CallFilter, Panda firewall and others...

So... does somebody know how these apps do the hang up action, (or terminate, or disconnect or whatever you call it..)?

And other question, if the first don't get a response.. does somebody know how send an incoming call to the voice mail?

Of course, all questions are about how to do it programmatically. So with the voicemail question I know there's a flag in contacts that is used for that, but like I said, I'd like to know the programmatical way.

Thanks all!

Edit 1:

I have been seei开发者_JAVA百科ng the LogCat traces using the application CallFilter and one trace seems to be interest, when it receives an incoming call, the PHONE_STATE is CALL_STATE_RINGING and fast appears one trace:

"05-03 19:32:34.416: INFO/UsageStats(78): Something wrong here, didn't expect com.android.phone to be paused"

and when CallFilter have done whatever do new trace "05-03 19:32:34.486:

INFO/UsageStats(78): Unexpected resume of com.android.phone while already resumed in com.android.phone"

appear, so i think CallFilter do something in one object com.android.phone, but i don't know how access to this.. any idea??

Edit 2:

I have performed at other times, and i don't see anymore the log traces above, so can be that the above may be that this does not mean anything.. i'm not sure.. the CallFilter application simply show one sec the incoming call, and then hang up.. how they do!!!???


I don't know how to hang up incoming calls, not sure if it's possible. You can, i think, enter airplane mode programmatically, but it's a brutal method and really not advised. Changing such a setting should be done only by the user when he chooses to.


You may try using this API:

http://www.androidjavadoc.com/0.9_beta/com/android/internal/telephony/ITelephony.html

0

精彩评论

暂无评论...
验证码 换一张
取 消