AlmightyMegadeth00 / omnidroid

Automatically exported from code.google.com/p/omnidroid
Apache License 2.0
0 stars 1 forks source link

Add "Phone Number" filter for "Phone Call Ended" event #95

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We should have a "Phone Number" filter for the "Phone Call Ended" event.

Original issue reported on code.google.com by case.and...@gmail.com on 23 Jun 2010 at 2:24

GoogleCodeExporter commented 8 years ago

Original comment by eligeler...@gmail.com on 30 Jun 2010 at 12:06

GoogleCodeExporter commented 8 years ago

Original comment by sv767%ny...@gtempaccount.com on 4 Jul 2010 at 4:05

GoogleCodeExporter commented 8 years ago

Original comment by sv767%ny...@gtempaccount.com on 4 Jul 2010 at 5:04

GoogleCodeExporter commented 8 years ago

Original comment by case.and...@gmail.com on 6 Jul 2010 at 2:20

GoogleCodeExporter commented 8 years ago
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 renc...@gmail.com on 6 Jul 2010 at 11:53

GoogleCodeExporter commented 8 years ago
not querying but we could store incoming number in 
phoneStateMonitor/PhoneStateMachine.

thanks

Original comment by sv767%ny...@gtempaccount.com on 7 Jul 2010 at 9:51

GoogleCodeExporter commented 8 years ago
did you write those phone state classes in helper/telephony? 

Original comment by sv767%ny...@gtempaccount.com on 7 Jul 2010 at 9:52

GoogleCodeExporter commented 8 years ago
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 renc...@gmail.com on 7 Jul 2010 at 11:42

GoogleCodeExporter commented 8 years ago
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%ny...@gtempaccount.com on 8 Jul 2010 at 12:28

GoogleCodeExporter commented 8 years ago
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 renc...@gmail.com on 8 Jul 2010 at 4:44