Screen off on incoming call, keeping ringer on

Post your questions and help other users.

Moderator: Martin

Post Reply
wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Screen off on incoming call, keeping ringer on

Post by wfrcrd » 16 Jan 2018 11:26

Hi to everyone,
I've tried to do it using the "press power button" workaround but this way it mute the ringer.
So I've tried changing the "Set System Setting with category System, Name screen_off_timeout" with value 1000 ,
sleep for 2 seconds and so on but the screen don't turn off and the flow end with an error :
something like "setting not verified": but I have seleced the "I have verified the setting";
maybe because the minimum timeout allowed on my samsung device is 15 seconds?

I've tried again using "press power button" workaround and set the speakers on again:
the result is that the screen turn on again and the ringer is still muted.

:roll:

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Screen off on incoming call, keeping ringer on

Post by Martin » 16 Jan 2018 15:50

Hi,

I think that most devices only allow a screen off timeout of at least 5 seconds, everything below this value is ignored or falls back to the five seconds.
You have to activate the checkbox as the last step when configuring the action. Every modification of the action will deactivate the checkbox again so you have to verify again. You can also turn this entire verification security measure off in the settings of Automagic (settings->General->Hide setting confirmation).

Regards,
Martin

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Screen off on incoming call, keeping ringer on

Post by wfrcrd » 16 Jan 2018 16:30

Thank you Martin,
but no way...
I've set 5 seconds, and I've tried using another app wich set the screen timeout for every specific application,
but the screen remanins on during the call.
I think I should turn the screen off using the "press power button" workaround,
but how can I keep the ringer on ?

After pressed the power button during a call, if I look at the statusbar (when the ringer is off and the call is still alive)
the speaker icon seems to be in a normal status, so I don't understand what action perform the system when I press
the power button during a call.
If knew it, I could perform a reverse action (maybe?).

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Screen off on incoming call, keeping ringer on

Post by Desmanto » 16 Jan 2018 17:01

To make sure we are on same page, you want to turn off the screen when in call, but preserve the ringer?

If so, it seems you have to turn off/on screen using other method than the power button. Proximity and device orientation can be the choices.

Flow 1 : Trigger incoming call, action enable flow 3 and 4
Flow 2 : Trigger Call ended, Action disable flow 3 and 4
Flow 3 : Trigger Proximity near, action turn screen off.
Flow 4 : Trigger Proximity far, action turn screen on.

If you use orientation, you can change the proximity near to device face down and proximity far to device face up.

The whole concept is very similar to Auto Call Speakerphone : viewtopic.php?f=3&t=6962
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Screen off on incoming call, keeping ringer on

Post by wfrcrd » 16 Jan 2018 17:37

Thank you Desmanto,
I don't know if have well understood,
it could be a good way but :
(be patient for my bad english)

when the "Trigger Proximity near" is on and there something near the sensor the screen turn off (and it's good) .
But if I move the phone and there's no more something near the sensor the screen turn on again ( and it's bad).
I've tried to set a long distance to force the condition of screen off , but the screen turn on again.

So, it's good when the screen goes off and preserve the ringer, but how can I leave it off until I press manually
a button?

Thank you

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Screen off on incoming call, keeping ringer on

Post by Desmanto » 16 Jan 2018 17:55

You can always mix it with device orientation, or adding sleep + condition to make it wait a while before turning on screen.
Example, flow 4 : Trigger device orientation Face right or Face left.
Just make it so flow 4 won't get triggered easily

Or if you need to make it more robust, you can use another alternative trigger, Shake. Set the sensitivity to the level you need (maybe low or very low), and try it out first.
Just make sure that flow 3 and 4 only active during call, as both of them use sensor and consume more power.
That's why we have flow 1 and 2 to enable/disable them.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Screen off on incoming call, keeping ringer on

Post by wfrcrd » 17 Jan 2018 10:56

Desmanto wrote: Flow 3 : Trigger Proximity near, action turn screen off.
Trigger Proximity near: no problem
action turn screen off : how ?
I mean what action should I choose to turn the screen off , preserving the ringer?

The only way to do this ACTION is : "Set proximity screen off state" ,
but this action turn the screen off AND turn the screen on , and I'm not able to
split those two action set, as you mentioned separately (flow 3 and flow 4).

I've tried another really rough solution :

Flow 1 trigger call incoming -> action power button (screen off, ringer off)->execute flow 2
Flow 2 no trigger, sound->play sound (as a ringer)

What I need now is to stop the sound when I answer the call
I hoped there was a trigger ->call answered but it' seems there's not!
:x

(thank you for you patience)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Screen off on incoming call, keeping ringer on

Post by Desmanto » 17 Jan 2018 17:34

Sorry, I forgot the context here. That flow assume we are on call, we have only two choice either near or far from the phone. The screen will be on/off depends on the proximity, since the phone is in call state. (it is automatic)

For your use case it won't be the same. To turn off screen, the one you tried using the set system setting is the only way to turn off without pressing power button (and lock the device). But do you try action Lock Device? Will it turn off the ring as well?

Assume that it also turn off the ringer, then your alternative workaround is the only viable solution now. We simply silent the real ringer from the phone and replace it with our own from automagic. There are a few other cases those can only be done using this way, we have no choice. Example someone in other forum need to auto reply/forward certain whatsapp message. But the unread notification from others (not in the auto reply/forward list) will make whatsapp cluttered the variable. So no other choice, we have to remove all of the notification and replace it with automagic's notification.

So Flow 1 and 2 is OK already. To stop the ringer, you can use the same trigger incoming call, but check the offhook (answer the phone). It means when you answer, this will trigger the flow and you can use stop action sound.
Basically you current flow 2 is redundant. You can just put the play sound at flow 1. Flow 2 use the trigger incoming call off hook and only single stop sound.

You can even combine them to single flow using expression to split the trigger as in index, dealing with multiple triggers. No disable/enable needed anymore, since the trigger is event, won't drain any battery.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Screen off on incoming call, keeping ringer on

Post by wfrcrd » 20 Jan 2018 14:56

Thank you Desmanto,
I don't use any lock on the phone, I don't like it and I prefer to block any important application.

Anyway I've solved as mentioned before, thank you !!!

Post Reply