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

时间: 2024-08-09 19:09:59

Tasker to stop Poweramp control for the headset while there is an incoming SMS - frozen的相关文章

Android权限列表permission说明

网络上不乏android权限列表,但是很少有将列表和使用方法放在一起的,所以特此总结一下 需要在AndroidManifest.xml中定义相应的权限(以获取internet访问权限为例),如下: < uses-permission   android:name ="android.permission.INTERNET"  /> 注意在<application>也可以定义INTERNET权限,如下: < application   android:per

转载——Android permission 访问权限大全

程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求, 完整列表如下: Android.permission.ACCESS_CHECKIN_PROPERTIES 允许读写访问"properties"表在checkin数据库中,改值可以修改上传( Allows read/write access to the "properties" table in the checkin database, to change values

Android的所有权限说明

Android权限分的很细,但命名比较人性化,Android permission比SymbianCapabilities有了不少改进,下面就来看看权限许可都有哪些定义吧,发现还是比较繁多的,如果发现你的程序某个地方调试错误很可能是Androidpermission的访问控制在作怪,这也是为了安全防止手机成为病毒的场所.Android开发网获取到的消息来看不用购买高昂的数字签名证书,权限许可权由用户决定而不是手机制造商和平台提供商,这一点不得不说明为Android开发人员着想,下面的信息都是需要

[Android]XML那些事儿-manifest属性1

在Froyo(android 2.2,API Level:8)中引入了android:installLocation.通过设置该属性可以使得开发者以及用户决定程序的安装位置. android:installLocation隶属于AndroidManifest.XML中的manifest节点.如下所示: <manifest xmlns:android="http://schemas.android.com/apk/res/android"package="string&q

Android中那些权限

Permission Permission Permission Group Permission Tree Users Permission ACCESS_CHECKIN_PROPERTIES 允许读写访问"properties"表在checkin数据库中,改值可以修改上传( Allows read/write access to the "properties" table in the checkin database, to change values th

解决某些Android Permission denied

最近遇到一个问题,总是在模拟器重报Permission denied错误,于是我直接在手机上测试,发现没有错误,于是很郁闷,反复在AndroidManifest中加入权限 <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&g

Android Permission 访问权限大全(转)

程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求, 完整列表如下: android.permission.ACCESS_CHECKIN_PROPERTIES允许读写访问”properties”表在 checkin数据库中,改值可以修改上传( Allows read/write access to the “properties” table in the checkin database, to change values that get upload

Android程序权限

android.permission.ACCESS_CHECKIN_PROPERTIES 允 许读写访问"properties"表在checkin数据库中,改值可以修改上传( Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded) android.permission.ACCESS_COARSE_LO

Android学习-- android 权限大全

android.permission.ACCESS_CHECKIN_PROPERTIES  允许读写访问"properties"表在checkin数据库中,改值可以修改上传( Allows read/write access to the "properties"table in the checkin database, to change values that get uploaded)    android.permission.ACCESS_COARSE_