Tasker to stop Poweramp control for the headset while there is an incoming SMS - frozen
If you usually like to use Poweramp or any other media player to enjoy the music with headset plugged, once you check the option “respond to headset button”, Poweramp will take care of your headset line controller instead, and if you are in the middle of playing a song while there is a sms message incoming? You are not able to press the button to listen to the sms message body, cause it would just pause/resume the song instead.
So what is the workaround?
Anyway, there is always another way out, right? Please proceed.
am force-stop packagename this linux command could force stop all process from this package
PM List Packages -------This Linux command will display all the apps installed on your phone
PM disable com.maxmpz.audioplayer -------this Linux command would disable the application including all process and service.
We may call it like frozen. Your device would not recognize this app like it has not been installed.
PM enable com.maxmpz.audioplayer ------this Linux command would enable the application to make the device recognizes this app has well installed.
Simply use tasker run shell with root for this command or you may use locale excute plugin for tasker if you prefer.
By the way, there is a better tool for you, it is secure settings for tasker.
After installed, you will find the option of package state(package manager for some other devices),
open this option, select the app of Poweramp, then you will see 3 options below for you to pick.
On, Off, Toggle.
I guess it might be much more convenient anyway.
Well, once the app has got frozen, it will not be able to control the headset button anymore.
At that time, you may press the headset button to listen to the incoming sms message body.
Profile 1:
Context 1: state-hardware-media button, button: next, Grab checked ------for android 2.2+, this option is available to grab the control priority for headset button if any other media player installed. PS. You better not pick “play” button, cause if you accidently click twice, it would fire to call back for your last phone call.
Context 2: state-app-unread text ----------this context is used to avoid the normal situation while there is no incoming sms, so tasker would not bother other media player to control the headset button.
Action: variable-variable set, name: %MEDIABUTTON, to On
Profile 2:
Context 1: event-phone-text received, type: sms ------- I have tested if using unread text as context, if you didn’t read the previous sms, and later there is another new message incoming, it would not fire.
Context 2: state-hardware, headset plugged
Action 1: plugin-secure settings, package state, poweramp set disable -----------in some othe android device, it could be package manager instead.
Action 2: task-wait 5 seconds -----------this action is to give secure settings enough time to carry on its job, since to do this would require root access.
Action 3: misc-say, text: you have got a new message from %SMSRN, press next button to listen, engine: default (if China user, please pick another TTS which supports Chinese.), stream: media
Action 4: task-wait 30 seconds until %MEDIABUTTON ~ On -------this step is to give you enough time to press the play button, if you didn’t, it will go activate poweramp on instead of saying the message body.
Action 5: task-If %MEDIABUTTON ~ On
Action 6: misc-say, text: %SMSRB, engine: default (if China user, please pick another TTS which supports Chinese.), stream: media
Action 7: variable-variable clear, name: %MEDIABUTTON -------this is to clear the variable value after done saying the message.
PS. You may add one more action here running sl4a script to mark current sms as read. So you don’t have to go back to the message inbox to clear wipe it off.
Action 8: task-goto, action number 10 -------this step is to pass through to activate poweramp after done saying the message
Action 9: task-else ---------if you didn’t press the play button in 30 seconds, this action would fire.
Action 10: plugin-secure settings, package state, poweramp set enable
Action 11: task-wait, 6 seconds
Action 12: plugin-autoshortcut, activity, select: com.maxmpz.audioplayer.StartupActivity -------I did try to use tasker load app, but it doesn’t work very well most of time.
PS. You may use wait 5 seconds, then Go home right there after action 8, optional for you.
Action 13: task-end If
Tasker to stop Poweramp control for the headset while there is an incoming SMS - frozen的更多相关文章
- Content portal for Pocketables Tasker articles
http://www.pocketables.com/2013/03/overview-of-pocketables-tasker-articles.html I write a lot about ...
- 蓝牙技术 A2DP AVRCP BlueZ
BlueZ 做为 linux 标准的协议栈,提供非常多的 profile ,各种的支持,ble , 蓝牙网络,文件传输,a2dp 音频传输. A2DP——Advanced Audio Distribu ...
- Android 权限列表
访问登记属性 android.permission.ACCESS_CHECKIN_PROPERTIES ,允许读写check-in数据库属性表的权限 ( Allows read/write acces ...
- Android Permission 访问权限大全(转)
程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求, 完整列表如下: android.permission.ACCESS_CHECKIN_PROPERTIES允 ...
- 解决某些Android Permission denied
最近遇到一个问题,总是在模拟器重报Permission denied错误,于是我直接在手机上测试,发现没有错误,于是很郁闷,反复在AndroidManifest中加入权限 <uses-per ...
- Android Permission中英对照
android.permission.ACCESS_CHECKIN_PROPERTIESAllows read/write access to the "properties" t ...
- Android permission 访问权限大全
程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求, 完整列表如下: android.permission.ACCESS_CHECKIN_PROPERTIES ...
- Android manifest之系统自带的permission
Android manifest之系统自带的permission 本文描述Android系统自带的permission.点击查看:“关于permission的原始定义和说明”.点击查看:“Androi ...
- Android权限列表permission说明
网络上不乏android权限列表,但是很少有将列表和使用方法放在一起的,所以特此总结一下 需要在AndroidManifest.xml中定义相应的权限(以获取internet访问权限为例),如下: & ...
随机推荐
- C# byte[] 转换16进制字符串
1.byte[] 转换16进制字符串 1.1 BitConverter方式 var str = DateTime.Now.ToString(); var encode = Encoding.UTF8; ...
- 数据库-mysql函数
一:MySQL中提供了许多内置函数 CHAR_LENGTH(str) 返回值为字符串str 的长度,长度的单位为字符.一个多字节字符算作一个单字符. 对于一个包含五个二字节字符集, LENGTH()返 ...
- No.10 selenium学习之路之通过元素定位获取属性
1. implicitly_wait()隐形等待.等待页面加载完成,作用是全局的. 时间可以设置的长,短时间也没有影响.直到设置的时间耗完 时间耗完也不会报错 2.获取title值 driver.ti ...
- 如何用纯CSS布局两列,一列固定宽度,另一列自适应?
大家都知道好多网站都是左右布局的,很多公司在笔试和面试环节也常常问这个问题.一个去网易的师兄说14年腾讯面试的时候问过这个问题,网易在笔试和面试时候也问过这个问题,还有很多互联网公司也都涉及到这个问题 ...
- AdvStringGrid 复选框、goRowSelect
var I: Integer; begin do begin AdvStringGrid1.AddCheckBox(, I, True, True); AdvStringGrid1.Cells[,I] ...
- TypeScript 2 : 获取当前日期及前后范围日期【Array】
前言 今天有个接口字段需求,要写一个今天及前几天的日期传过去: 在网上找了下都木有什么比较好的方案:就自己写了一个. 因为技术栈就是NG2+TS2+WEBPACK,这里的代码需要一定的TS2及ES6的 ...
- Sql Server2005 Transact-SQL 新兵器学习总结之-排名函数
Transact-SQL提供了4个排名函数: rand() , dense_rand() , row_number() , ntile() 下面是对这4个函数的解释:rank() 返回结果集的分区内每 ...
- Linux学习笔记:pwd与dirs的区别
在Linux中可以使用pwd和dirs进行当前目录查看,分别用于显示当前目录和显示完整目录记录.具体如下: 1.pwd 显示当前目录 2.dirs 显示目录堆叠中的记录 END 2018-08-21 ...
- vector 测试
vector 测试 */--> div.org-src-container { font-size: 85%; font-family: monospace; } pre.src { backg ...
- GUC-7 同步锁 Lock
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /* * 一.用于解决 ...