Over the weekend I got an email from a reader, Kapil, regarding a problem he has in Tasker. One of the most common Tasker profiles out there is to have it mute the ringer when the phone is flipped with the screen facing down, but he wanted a more intelligent version that would allow the phone to already be facing down when the phone came in, without muting it until he’d had a chance to pick it up, look at the screen, and the put it with the screen facing down again.

I tried a few different ways of doing this, and came up with one that’s fairly simply- although it does require three individual profiles.

Profile 1:
Contexts:
1: Call, Type: Incoming
2: Orientation, Face Down, inverted
Task:
A1: Variable Set %Callorientation To 1

 

Profile 2:
Contexts:
1: Variable Value, %Callorientation Matches 1
2: Call, Type: Incoming
3: Orientation, Face Down
Task:
A1: Silence Ringer

 

Profile 3:
Contexts:
1: Phone Idle (Event context)
Task:
A1: Variable Set %Callorientation To 0

 

Combined, these three profiles make it so that the orientation-based silencing profile only triggers if the screen has been facing any direction but face down earlier in that call. In other words, if the phone is not facing down when the call comes in, flipping it that way will mute it, but if it is facing down, it needs to be flipped first in order for that option to be available.

This is done with the use of the %Callocation variable. This variable is set to 1 when the phone is ringing and the phone is not facing down. Note the difference between an inverted Face Down context and a Face Up context; the latter only requires that the phone isn’t facing down, instead of requiring it to face another specific direction. When that variable is set, the mute profile will be able to trigger, using a standard combination of incoming call and orientation variables. If the phone is facing down when the call comes in, the variable won’t be set, and thus it won’t trigger the profile until the phone is first flipped, triggering the profile to set the variable.

The final profile is there to reset the variable when the phone becomes “idle”, meaning the call ended in some way. That ensures that it won’t stop working after the first call.

The video below shows this working on my Galaxy S II. Silence Ringer isn’t available on my device, so I used End Call instead for this demonstration. You might have to disable the restore settings option for the profile to prevent the ringer from turning back on if you flip the phone again while it’s ringing, but I have no way of checking if that’s necessary.

Do note that this setup uses several Tasker options which are known to not be available or work properly on all devices, like I talk about here. This is intended as a modification to a common Tasker profile for those who have a device where all the necessary features are supported. If it doesn’t work for you personally, there’s literally nothing I can do about it, as it’s then device/ROM-related.