Page 1 of 2

High Volume Warning - Another option

Posted: 07 Oct 2017 20:49
by Trent Bates
Hi all,

First post here so bear with me! :)

I've been using AutoMagic for a couple of months. I had previously been a Llama user for about 4 years. I'm really enjoying AutoMagic!

I've looked into the handful of posts about dealing with the High Volume Warning that we get with headphones, bluetooth, etc. and have happened across a very specific method that doesn't appear to be fully described here. The idea has been presented, but it seems the details have not been posted that I can find.
I have tried some of the previous ideas within my car flow with varying success (sometimes it would work, other times it didn't), but it didn't account for other situations. This new flow seems to work nicely for me. You might not have the same luck as I have with it. I'm running it on an unrooted Samsung Galaxy S4 with v5.01.
flow__Volume_Warning_Override_20171007_161520.xml
(2.18 KiB) Downloaded 762 times
20171007_163317.png
Flow view
20171007_163317.png (67.3 KiB) Viewed 15543 times
20171007_163439.png
Trigger view
20171007_163439.png (168.54 KiB) Viewed 15543 times
This might be obvious to many of you, but for new people like me, it wasn't. :) I arrived at the proper entries by opening the UI Event trigger screen, going out to a media player and playing something, then turning up the volume (after a fresh reboot) with headphones plugged in to get the warning window. Once that occurred, I came back to the UI Event screen and clicked on "RECENT EVENTS" and selected the correct event.
Hopefully, this flow will help someone. :)

[Edited to add:] I found that I did not need a delay of any sort for the "click("OK")" portion.

Good luck! Sorry for the huge images!! I hope they are smaller when posted!
--Trent

Re: High Volume Warning - Another option

Posted: 30 Nov 2017 06:17
by sallyslak
I've been meaning to say thanks for this for some time! There are so many complicated solutions out there, usually requiring multiple apps and more skill than I possess, so this was perfect. Thanks!

Re: High Volume Warning - Another option

Posted: 30 Nov 2017 15:17
by Trent Bates
Thanks a bunch! ;)

To all,
I'm hoping that the new restrictions that Google is putting on the Accessibility Service won't mess things up for future users! In this flow, "UI Event" will probably be affected. See viewtopic.php?f=2&t=7079 for more info.

Re: High Volume Warning - Another option

Posted: 29 Dec 2017 07:39
by syndromtr
there's another way i guess, seems working after 2 days of testing.
please comment if it has issues...

Trigger : Automagic Startup

Action : Sleep - 30s

Action : Set System Setting :
Global
audio_safe_volume_state
2

it needs "Set System Setting" permissions. works on non-root. normally, above value is 3 by default and after a static time of music/media play, it displays naggy high volume warning. with value 2, never!

EDIT: this is for startup. or you can automatically set this value to 2 with periodic timer inexact (after 1 hour is ok)

Re: High Volume Warning - Another option

Posted: 29 Dec 2017 14:40
by Trent Bates
Great info! :)

I will have to try that method as well. I remember seeing that option, but did not go that far into it.

Re: High Volume Warning - Another option

Posted: 29 Dec 2017 15:41
by syndromtr
if above doesn't work. another way:
quoted from XDA:

"This doesn't work because there is another setting that overrides "audio_safe_volume_state" and that is "unsafe_volume_music_active_ms"in the secure settings. This value counts up in ms and once it reaches 72000000ms (20 hours) it will reset the volume state. If you are listening to music during the time this happens it will drop the volume below the safe threshold and require you to again bypass the warning. You can reset the "unsafe_volume_music_active_ms" value using the same guide above before it reaches 20 hours but it will not take effect until you reboot your phone."

so, a periodic trigger with

Action : Set System Setting :

Secure
unsafe_volume_music_active_ms
0

should do the trick.

Re: High Volume Warning - Another option

Posted: 31 Dec 2017 21:31
by Trent Bates
Cool!

Re: High Volume Warning - Another option

Posted: 10 Jan 2018 11:15
by patrick2point2
syndromtr wrote:if above doesn't work. another way:
quoted from XDA:

"This doesn't work because there is another setting that overrides "audio_safe_volume_state" and that is "unsafe_volume_music_active_ms"in the secure settings. This value counts up in ms and once it reaches 72000000ms (20 hours) it will reset the volume state. If you are listening to music during the time this happens it will drop the volume below the safe threshold and require you to again bypass the warning. You can reset the "unsafe_volume_music_active_ms" value using the same guide above before it reaches 20 hours but it will not take effect until you reboot your phone."

so, a periodic trigger with

Action : Set System Setting :

Secure
unsafe_volume_music_active_ms
0

should do the trick.
Can you link your flow thanks.

Re: High Volume Warning - Another option

Posted: 17 Jan 2018 14:22
by cjt7777
This is extremely helpful, many thanks!

Re: High Volume Warning - Another option

Posted: 25 Aug 2018 14:13
by sallyslak
Hi - I'm trying to grant the write-secure-settings permission to Automagic but I don't know what the package name should be - eg.
adb shell pm grant com.automagic android.permission.WRITE_SECURE_SETTINGS

Can anyone help? Thanks in advance.

Oh wait - found it - if anyone else needs it it's ch.gridvision.ppam.androidautomagic