modemmonitor: use dbus-monitor
Instead of looping over mmcli commands to check for incoming calls and texts every 3s, use dbus-monitor to tell us when something is coming in. This should save some battery life as well as reduce the delay in new call/msg notification. I was running on the latest released scripts, so have not strictly tested this with git master. Note that I dropped the call to checkmissedcalls. Perhaps we should still run that at firststart? Signed-off-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
parent
1b45e7743d
commit
99099a359f
1 changed files with 10 additions and 6 deletions
|
@ -125,12 +125,16 @@ checkfornewtexts() {
|
|||
}
|
||||
|
||||
mainloop() {
|
||||
while true; do
|
||||
checkformissedcalls
|
||||
checkforincomingcalls
|
||||
checkfornewtexts
|
||||
sleep $TIMEOUT & wait
|
||||
done
|
||||
dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Voice',type='signal',member='CallAdded'" | \
|
||||
while read line; do
|
||||
checkforincomingcalls
|
||||
done &
|
||||
dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Messaging',type='signal',member='Added'" | \
|
||||
while read line; do
|
||||
checkfornewtexts
|
||||
done &
|
||||
wait
|
||||
wait
|
||||
}
|
||||
|
||||
mainloop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue