easyclick执行拨号或者预设电话号码
/** * 跳转到拨打电话【需要代理权限】 * @param phone_Number {string}需要拨打的电话号码 * @param manner {string} 默认为CALL[直接拨打] DIAL 打开拨号页面 * @returns {boolean} 成功返回true 失败返回false */ function call_phone(phone_Number,manner) { manner= manner || "CALL"; let json_obj={ "action":"android.intent.action."+manner, "uri":"tel:"+phone_Number } let result =utils.getStartActivityCmd(json_obj); return !!shell.execAgentCommand(result) } //调用方式 call_phone(10086,"DIAL")
调用效果:
call_phone(10086,”DIAL”)
调用效果:
call_phone(10086,”CALL”)