I'm implementing a function where an outgoing alarm is triggered, f.e. If the phone falls down and doesn't move for 60s afterwards. Then, between 1-5 numbers should be called. Example of how it should work:
- Phone falls down and doesnt move for 60s
- Number 1 is called
- Number 1 doesn't accept call in 20s
- Number 2 is called
- Number 2 doesn't accept call in 20s
- Number 3 is called
- Number 3 accepts call, alarm is being terminated
The alarm is triggered correctly, and I can make a call. But I couldn't find anything on how to determine if a call was accepted after x seconds, and how to start a new call then. Any help / sources?
Edit: Via the PhoneStateListener I'm now able to see if the call was cancelled. However if it's not, I can't get the actual state, so I don't know if it's still ringing, if it's actually calling or if it has gone to the mailbox. In the description of the CALL_STATE_OFFHOOK it's pretty clear that you can't see wheter the call was answered or the number has just been dialed. Is there any workaround for that, maybe even with rooting the phone or something like that? Any hint is appreciated.
It seems like this isn't possible.
The documentation for Intent.ACTION_CALL states that it doesn't return an output (at least I guess that's what the oh-so-helpful "Output: nothing" comment means).
Similar questions here and here have not gotten any useful positive responses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With