View Single Post
Posts: 1,425 | Thanked: 983 times | Joined on May 2010 @ Hong Kong
#7
Hi Pelago,

Originally Posted by pelago View Post
Can I just make sure I've got the general idea of your program correct, based on my inexpert reading of the code: The program runs continuously in the background. When it detects an incoming call, it quickly changes the system-defined ringtone using a symbolic link, based on a lookup of which phone number should be in which group. The actual playing of the tone is done by the phone app itself. Is that right?
Correct. As the phone will play the same clip for all calls. The program is then changing the pointer (aka symlink) of that clip according to the caller number, before the phone play that clip.

[/quote]
I'm just wondering what happens if for some reason the phone app gets there first and starts playing a different ringtone, before your app gets a chance to change the symlink. Will the ringtone change half-way through?
[/quote]

The script setup an event loop to pick up signal. I'm sure the race condition you've mention would happen. Anyone would suggest a better way to preempt the ringing would be welcome. ^^

Does your app impact battery life, if it is running in the background all the time?
It'd absolutely increase the load thus drain battery, but it's pretty lightweight. Any suggest to benchmark electricity consumption?

Thinking about a potential GUI, obviously there would need to be a way to define groups (giving each a custom name would be nice), plus a way to pick a ringtone per group. Then there would need to be a way to associate a contact with each group. I wonder if there's a way to hook into the contacts framework to do this. Maybe the group could be stored as a Note field in the contact, or something like that.
UI....but I'm not sure whether I'd continue its development. As I said, this script is served as a 'reply' to some negative comments against N900. A working program is better than thousands words. XD

However, creating extra column in each contact and have the program read that column to determine its ringtone is a very good idea. It doesn't require much effort to accomplish. May be I would enhance it a bit for that... later. ^^

Last edited by 9000; 2010-05-14 at 14:23.