* The sxmo_modemmonitor.sh will now run a new sxmo_modemcall.sh dedicated menu to Pickup, Hangup or Mute the call. It will not write notifications anymore. * We now can mute the ring with the new pickup menu. With the default hook, this will stop the ringtone like the missed_call would do. * The sxmo_modemcall.sh now use a new sxmo_proximitylock.sh which will lock the screen when putting the phone in front of the ear. This script should be smart enough to work smoothly with a crust context. To achieve this, the proximity_lock will only disable the initial lock (the one who want to go back in crust after some seconds) if the phone moved a little bit and is not in your pocket. So forgetting the phone in a table or not earing the ring in your bag will not empty the battery. You'll find the phone in crust with notifications. * The sxmo_modemcall.sh do not monitor finished calls anymore. We leave it with hangup or being killed by sxmo_modemmonitor.sh. This simplify the call script and prevent double deleting mmcli calls. I had to use pids and wait commands to fix and issue and make the script killeable by the monitor. Plus, only the monitor will now delete calls. The call script should be precise on what happen using cached files. * Discarded and hanged up calls are two different behavior with different script (by default use the same linked ones) * Fixed a bug where sometime ringing was started twice. I think this is cause by the new checkforincomingcalls in the connected state change. We now use a file to test if the call already has been managed. Signed-off-by: Stacy Harper <contact@stacyharper.net> Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>master
parent
6423ece891
commit
f4ee396394
7 changed files with 167 additions and 51 deletions
@ -0,0 +1,5 @@ |
|||||||
|
#!/usr/bin/env sh |
||||||
|
|
||||||
|
# This script is executed (asynchronously) when you discard an incoming call |
||||||
|
|
||||||
|
exec "$(dirname "$0")/missed_call" "$@" |
@ -0,0 +1,5 @@ |
|||||||
|
#!/usr/bin/env sh |
||||||
|
|
||||||
|
# This script is executed (asynchronously) when you mute an incoming call |
||||||
|
|
||||||
|
exec "$(dirname "$0")/missed_call" "$@" |
@ -0,0 +1,19 @@ |
|||||||
|
#!/usr/bin/env sh |
||||||
|
|
||||||
|
anglevel_x_raw_bus="$(find /sys/ -name 'in_anglvel_x_raw')" |
||||||
|
anglx() { |
||||||
|
cat "$anglevel_x_raw_bus" |
||||||
|
} |
||||||
|
|
||||||
|
waitmovement() { |
||||||
|
initialpos="$(anglx)" |
||||||
|
while true; do |
||||||
|
pos="$(anglx)" |
||||||
|
movement="$(echo "$initialpos" - "$pos" | bc)" |
||||||
|
[ 0 -gt "$movement" ] && movement="$(echo "$movement * -1" | bc)" |
||||||
|
[ 10 -lt "$movement" ] && return |
||||||
|
sleep 0.5 |
||||||
|
done |
||||||
|
} |
||||||
|
|
||||||
|
"$@" |
@ -0,0 +1,41 @@ |
|||||||
|
#!/usr/bin/env sh |
||||||
|
|
||||||
|
finish() { |
||||||
|
kill $(jobs -p) |
||||||
|
[ free = "$STATE" ] && [ true = "$WASLOCKED" ] && sxmo_lock.sh & |
||||||
|
exit 0 |
||||||
|
} |
||||||
|
|
||||||
|
trap 'finish' TERM INT |
||||||
|
|
||||||
|
proximity_raw_bus="$(find /sys/ -name 'in_proximity_raw')" |
||||||
|
distance() { |
||||||
|
cat "$proximity_raw_bus" |
||||||
|
} |
||||||
|
|
||||||
|
TARGET=30 |
||||||
|
|
||||||
|
mainloop() { |
||||||
|
while true; do |
||||||
|
distance="$(distance)" |
||||||
|
if [ locked = "$STATE" ] && [ "$distance" -lt "$TARGET" ]; then |
||||||
|
pkill -f sxmo_lock.sh |
||||||
|
STATE=free |
||||||
|
elif [ free = "$STATE" ] && [ "$distance" -gt "$TARGET" ]; then |
||||||
|
sxmo_lock.sh --screen-off & |
||||||
|
STATE=locked |
||||||
|
fi |
||||||
|
sleep 0.5 |
||||||
|
done |
||||||
|
} |
||||||
|
|
||||||
|
pgrep -f sxmo_lock.sh > /dev/null && STATE=locked || STATE=free |
||||||
|
if [ locked = "$STATE" ]; then |
||||||
|
WASLOCKED=true |
||||||
|
|
||||||
|
# we dont want to loose the initial lock if the phone is forgotten somewhere |
||||||
|
# without proximity as this will prevent going back to crust |
||||||
|
sxmo_movement.sh waitmovement |
||||||
|
fi |
||||||
|
|
||||||
|
mainloop |
Loading…
Reference in new issue