AutoSpeakerphone during Call with Proximity & Control UI

Post your questions and help other users.

Moderator: Martin

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

Re: AutoSpeakerphone during Call with Proximity & Control UI

Post by Desmanto » 11 Sep 2017 07:12

I have combined the flow. Even though the screen is off, the flow seems still executing. It is something. :o I need more test before share it.
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.

pickone
Posts: 22
Joined: 08 Sep 2017 14:52

Re: AutoSpeakerphone during Call with Proximity & Control UI

Post by pickone » 11 Sep 2017 08:56

Thank you

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

Re: AutoSpeakerphone during Call with Proximity & Control UI

Post by Desmanto » 12 Sep 2017 15:48

The Auto Speakerphone has been posted, check it out
http://automagic4android.com/forum/view ... 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.

pickone
Posts: 22
Joined: 08 Sep 2017 14:52

Re: AutoSpeakerphone during Call with Proximity & Control UI

Post by pickone » 12 Sep 2017 17:33

I tested the autospeaker... but... let me tell you what is working and what is not (btw, I changed the com.android.dialer with com.android.incallui, to work with my phone OnePlus 5)

- If I cover/uncover the proximity very fast... I can make the speakerphone ON when the proximity is covered or viceversa (sometimes an error in the notification bar is showing: Emergency Stop: Interrupting and disabling flow "Proximity auto speakerphone"
- Sometimes, after 1-2-3 calls and testing the proximity cover/uncover... the phone is changing the Check(....) value to inverted, the behave will be: when cover - speaker on, when uncover - speaker off (I dont know why is doing this) maybe there is other function to check/uncheck the speakerphone button, a more exactly function... I dont know (I must restart the phone if I want to flow working properly again)
- Another thing... the uncovering event is not working every time, even if is not too fast the cover/uncover action. Or sometimes is not working at all the "ON" function...

And a good feature which should have is: when I start the call, or I answer to a call... and IF proximity is not covered, the phone should start in speakerphone on

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

Re: AutoSpeakerphone during Call with Proximity & Control UI

Post by Desmanto » 13 Sep 2017 02:36

1. Emergency stop >> seems your phone trigger the proximity so often. Maybe the proximity polling is too fast, nothing you can do with that. Try to change the proximity flow execution to "Skip execution..." This ensure only single event at one time.
2. Inverting also may caused by the too frequent polling. Try to check the proximity value at the trigger, when you cover/uncover it. Mine only shows 0 and 5 cm
3. When the flow is disable caused by emergency stop, it won't work anymore.

For startup speakerphone, just need to add condition to check it.
If proximity far, then control ui turn on speakerphone. Just copy the elements from proximity flow.
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.

pickone
Posts: 22
Joined: 08 Sep 2017 14:52

Re: AutoSpeakerphone during Call with Proximity & Control UI

Post by pickone » 13 Sep 2017 13:24

1. It is already putted on "skip...."
2. How can I see the value in real time?

One more question, there is any log window where I can see a value of a variable every time, mostly when it changes? I was using the dialog view, but is not very good to use...

Oh, another idea about changing the speakerphone status... Now, we (you more :)) ) are trying to make the speakerphone on/off by the proximity status, clicking a button with the Control UI... There is any other action which can modify the speakerphone state? I mean like... a function (not a button clicked), I ask this because maybe it can work better and maybe it can work even If I am doing something else on the phone, not keeping the phone everytime on the dialer window... I dont know, some expression or code...

The most phone are using com.android.dialer:id... mine is using the com.android.incallui:id ... I dont know, just saying, maybe you know better...

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

Re: AutoSpeakerphone during Call with Proximity & Control UI

Post by Desmanto » 13 Sep 2017 15:08

When you edit the Trigger at proximity flow, you can see the "Current Value" under the Distance. That is the real time value. Cover/uncover it to see the value changes.

Afaik OP5 has this feature already built-in in the dialer, do you check the advanced setting at the dialer?

You can use script log(proximity) to log the value directly. But you need to check the log again. Or you can you action write to file, use append, put the variable and enter a blank line (so it always log at new line). You can include the triggertime to make it more detail. I use the same to catch the toast message or notification. There is another way, to addElement() to GloVar, so it will stacked up and can be check later.

I don't much about the way to turn on speakerphone if your phone doesn't support. Try to logcat my dialer and phone, tap the speakerphone on/off, can't find any intent/activity to turn the speakerphone on. So in this case, Control UI is your only friend. I think, if you really do something with your phone during the call, most likely you won't put it to ear anymore right? If that so, then it suppose not to be a problem. You simply need to tap to return to the dialer and put it to your ear again to turn off the speaker.
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.

pickone
Posts: 22
Joined: 08 Sep 2017 14:52

Re: AutoSpeakerphone during Call with Proximity & Control UI

Post by pickone » 13 Sep 2017 15:43

0 and 5 cm proximity for my phone also... I did checked the settings from dialer, but I didnt find any similar setting...
So sad about this thing :(
About the feature of working even when I do something else... is very useful when you are doing stuff on your office and if someone gets into your office, you can put it to the ear and no one will hear what you talk on the phone

Post Reply