LibreTasks
LibreTasks copied to clipboard
Add "Phone Number" filter for "Phone Call Ended" event
We should have a "Phone Number" filter for the "Phone Call Ended" event.
Original issue reported on code.google.com by [email protected]
on 23 Jun 2010 at 2:24
Original comment by [email protected]
on 30 Jun 2010 at 12:06
Original comment by sv767%[email protected]
on 4 Jul 2010 at 5:04
Original comment by [email protected]
on 6 Jul 2010 at 2:20
The biggest hurdle I had when I created the phone call ended event is
supporting the phone number filter for the outgoing calls (you can see more
details of this problem on the javadoc of the CallEndedEvent and how the
omnidroid detects a phone call ended in
http://code.google.com/p/omnidroid/wiki/PhoneCallStateTransition)
One idea I just came out recently is to kind of "cheat" by querying the phone
logs and get the phone number from the latest entry. This will only work if it
is guaranteed that Android sends the offhook intent after updating the phone
logs.
Original comment by [email protected]
on 6 Jul 2010 at 11:53
not querying but we could store incoming number in
phoneStateMonitor/PhoneStateMachine.
thanks
Original comment by sv767%[email protected]
on 7 Jul 2010 at 9:51
did you write those phone state classes in helper/telephony?
Original comment by sv767%[email protected]
on 7 Jul 2010 at 9:52
Yes. I am the one who wrote them. Do you have any questions about it? And by
the way, how are you planning to get the number for the phone call ended for
outgoing calls?
Original comment by [email protected]
on 7 Jul 2010 at 11:42
I was thinking to have ringingNumber and activeCallNumber in PhoneStateMonitor.
if (phone is ringing) ringingNumber=incomingNumber
if ( phone's off-hook) activeCallNumber=ringingNumber
problem remains when you have two active calls. let's try to catch that event
first, and then I'll think what I can do to get phone number.
I didn't even think about outgoing calls. :(:( good point.
About phoneState I thought there were too many classes or too many files at
least. I'm sure they serve some purpose, let's discuss it when we meet.
Original comment by sv767%[email protected]
on 8 Jul 2010 at 12:28
About the state classes, it was not my original idea. It is actually an
implementation of the State Pattern:
http://en.wikipedia.org/wiki/State_pattern
Original comment by [email protected]
on 8 Jul 2010 at 4:44