Volume values from "Init variable system setting"?

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Volume values from "Init variable system setting"?

Post by kintrupf » 09 Jan 2014 12:38

When I use the action "Set Audio Volume" to set the ringer volume to 0 I would expect that afterwards the action "Init variable system setting" (name=volume_ring) would return 0.
The status bar indicates that the volume is indeed muted. However, on my phone (Nexus 4, KitKat 4.4.2) this action always returns the value 5.
So what are those values?

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Volume values from "Init variable system setting"?

Post by MURTUMA » 09 Jan 2014 16:55

I do not know the technical details behind this, but ringer mode and ringer volume are independent from each others. It seems that phone stores the silent status to ringer but not in volume level variable.

As I said I don't have any knowledge to back this up but I've made a little empirical study:
1. set ringer volume to max
-> set ringer mode to silent or vibrate from status bar
-> press volume up in home screen
-> your ringer volume is back to max

2. Set your ringer mode to normal
-> press volume down until the ringer mode turns to silent/vibrate
-> press volume up ONCE
-> ringer mode is back to normal and volume is on level 1

Conclusion: silent volume level gets stored only in variables handling ringer mode but not to volume level variables.

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Volume values from "Init variable system setting"?

Post by kintrupf » 09 Jan 2014 20:16

MURTUMA wrote: Conclusion: silent volume level gets stored only in variables handling ringer mode but not to volume level variables.
Yes, I noted the same behaviour.
But that's not the problem, maybe my example was bad.
If I set the ring level to 1 (and ringer mode to "normal") I would expect that "Init variable system setting" (name=volume_ring) would also return 1. But it always returns 5, so that I can't get the current ring level only.
However, if I use the action "Store Audio Volumes" the global variable "global_volume_ring" does contain 1. But this "trashes" these global variables which might have been saved for other purposes...

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Volume values from "Init variable system setting"?

Post by MURTUMA » 09 Jan 2014 21:27

Android itself uses global_volume_x variables, not volume_x variables which are local. You may have set the local variable to 5 yourself. Depending on what you're trying to achieve, you should maybe store the global variable to another variable in another flow, so you don't mess the original up.

Post Reply