简体   繁体   中英

Outgoing CALL_STATE

How can I access the current status of an outgoing call (dialing, active, etc.)?

In my application I want it that all the LEDs on the device are inactive for the duration of the "call-active status", but during the "dialing status" and after the call is ended the LEDs should be on. I need to read out (or capture) the status - but how?

I have already read that one can not question the CALL_STATE_OFFHOOK .

Is it possible to infer the status via the GUI (phone screens)? Or is there another possibility?

I know that this is not a new topic but I´m only looking for the "dialing/active/disconnected" statuses - the rest (holding, alerting, incoming,...) don´t matter.

If the gui changes there must be a possibility to read that "changing behaviour out" and use it .... or am I too naive?

You can use AudioManager to get the current audio state, effectively seeing if you are currently in a call or not.

mAudioManager.getMode() == AudioManager.MODE_IN_CALL

if that returns true, then your user is in a call, otherwise they aren't. I know this isn't a full solution to your problem, but it might help if other things are not possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM