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访问权限为例),如下: & ...
随机推荐
- JS点击事件的重叠处理(多个点击事件出现冲突)
最近开发遇见了一个这个样的情况,一个button在一个div中,点击buton是一个事件,点击大的div也是一个事件,但是由于button在div中,点击button会把两个事件都执行了,但是我们想点 ...
- TypeScript的配置文件 tsconfig.json
//tsconfig.json指定了用来编译这个项目的根文件和编译选项 { "compilerOptions": { //compilerOptions:编译选项,可以被忽略,这时 ...
- Luogu P2310 【loidc,看看海】
各位大佬都用的排序和杨颙大定理,蒟蒻的我怎么也不会做(瑟瑟发抖),那么,就来一发主席树吧.我们知道线段树可以维护区间,平衡树可以维护值域那么,我们可以用线段树套平衡树来解决这个区间值域的问题线段树套平 ...
- 20165203《Java程序设计》第三周学习总结
教材学习内容总结 1.类: (1)类的声明:class+类名 (2)类体:成员变量的声明+方法(局部变量+语句) 注意: 方法体内声明的局部变量只在方法内有效和书写位置有关. 局部变量和成员变量同名: ...
- NOIP2015&2016普及组解题报告
NOIP2015普及组题目下载 NOIP2016普及组题目下载 NOIP2015普及组题目: NOIP2018RP++ NOIP2016普及组题目 NOIP2018RP++ T1 金币\((coin. ...
- spark java API 实现二次排序
package com.spark.sort; import java.io.Serializable; import scala.math.Ordered; public class SecondS ...
- 自定义Adapter为什么会重复多轮调用getView?——原来是ListView.onMeasure在作祟
相信很多人在使用自定义Adapter的时候都遇到这样的问题: 假设Adapter数据源中只有30个Item,理论上每显示一个新的Item的时候就会调用一次getView,均显示一次的话是要调用getV ...
- mysql千万级表关联优化(2)
概述: 交代一下背景,这算是一次项目经验吧,属于公司一个已上线平台的功能,这算是离职人员挖下的坑,随着数据越来越多,原本的SQL查询变得越来越慢,用户体验特别差,因此SQL优化任务交到了我手上. 这个 ...
- 认识loadrunner及相关性能参数
认识loadrunner及相关性能参数 LoadRunner,是一种预测系统行为和性能的负载测试工具.通过以模拟上千万用户实施并发负载及实时性能监测的方式来确认和查找问题,LoadRunner能够对整 ...
- docker 删除none镜像
Windows版本,参考官方地址:https://forums.docker.com/t/how-to-remove-none-images-after-building/7050 docker rm ...