Tasker to detect and vibrate once the ougoing call is being answered

I happen to find that for GSM standard phone, call duration would be created into sql database only if the outgoing call is being answered, or after hanging up if it is not being answered.

So i guess this method is meant for CDMA android phone only. cause we could not detect if outgoing call is offhook by the callee via tasker or sl4a.

Java code would be the solution i think, by monitoring the phone state.
 
 
If you are interested, please follow my profile instruction below and run some test, please further advise me if it is working or any issues. many thanks!
 
 
NB.: to run sqlite 3 command, you must make sure your phone has installed the proper sqlite3 file and you must root your phone first to run sqlite3 command.
 
Tips:
download the sqlite3 file via the links below and renane it as "sqlite3" if it is not, then put it under the phone root directory /system/bin folder, and don't forget to modify the permission for the sqlite3 file to be
rwxr-xr-x
 
android 4.0 or earlier:  http://bit.ly/sqlite3
  
 
profile:

context: state-phone-call, type:outgoing
 
task:
 
action 1: script-run shell,
command:
sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "select duration from calls where type <= 2 order by date desc limit 1;"
 
use root checked, store result in %VIBRATING 
 
action 2: alert-vibrate, 200ms, if %VIBRATING  ~   1
 
action 3: task-goto, action number 2, if %VIBRATING    !~   1
 
Action 4: task-stop, if %VIBRATING  ~   1

转载于:https://www.cnblogs.com/shangdawei/p/4510917.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值