Device orientation (face down) bug

Post your questions and help other users.

Moderator: Martin

Post Reply
colabi
Posts: 134
Joined: 06 Jan 2013 22:33

Device orientation (face down) bug

Post by colabi » 31 Oct 2017 22:40

Hi, Martin

Try this:

Flow inactive
Trigger:
device orientation > face up
Activate flow (not "execute" - greyed button become blue) > nothing happens (normal)

Flow inactive
Trigger:
device orientation > face down
Turn phone upside down, but to see it somehow
Activate flow > flow is triggered (anormal)

Thanks

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

Re: Device orientation (face down) bug

Post by Desmanto » 01 Nov 2017 03:53

Do you mean when the phone is face up, the trigger face up was not triggered? While when trigger set to face down, but phone face up, the flow was triggered? Kinda like inverted/reversed?

If so, it is either your phone accelerometer calibration is off the chart or the phone sensor was inverted from the beginning.

Inaccurate sensor probably caused by strong magnet. You have to recalibrate it at the settings. The calibration menu is in different location depends on the phone/ROM. You gotta find it by yourself. Usually it is located at display, more settings or maybe advanced settings. Some phone probably put the calibration menu in separate app. After you find it, put your phone on flat surface and calibrate it. You can try the trigger now.

If it was inverted from beginning, there is nothing you can do. Some manufacture when they assemble the sensor, they found out it was inverted. Rather than reassemble the whole production line, they simply make a "dirty fix" by reversing the raw reading in the kernel or software reading. You have to remember the inversion then. If face up is inverted to face down, then you have to reverse everything you use in the flow. Maybe Martin can add a new workaround option to reverse the reading back, for 3 axis.

====================
You can do additional test to check. Don't use trigger device orientation. Just add condition Device Orientation - Face Up (the same, but state version). Then drag a new true branch, add condition debug dialog.

Put the phone face up on flat surface and execute the flow manually, see if the debug dialog pop up. If it just stop at condition device orientation, then change face up to face down. Try again. The debug dialog should shows you accel_x and y approximately 0 (probably from -0.1xxxxx something to 0.1xxxxx) and the accel_z should be around 9.8 or -9.8 (earth's gravity).

You can repeat the same process for face left/right and standing upright/upside down; where only 2 value around 0, while the 3rd one around 9.8.
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.

colabi
Posts: 134
Joined: 06 Jan 2013 22:33

Re: Device orientation (face down) bug

Post by colabi » 01 Nov 2017 10:38

Sorry if I was not clear enough

Create a flow with two triggers. Leave it inactive

Trigger 1: device orientation > face up
Trigger 2: device orientation > face down

Put the phone on a table and activate the flow. The flow won't trigger and this is normal.

Deactivate flow

Take the phone and put it above your head faced down, then activate the flow. The flow will trigger and this is not the expected behaviour. The trigger must not be triggered, like in first case

I tested on Nexus 5x - Oreo and LG G2 mini - Cyanogen 14

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

Re: Device orientation (face down) bug

Post by Martin » 01 Nov 2017 20:30

Hi,

The trigger should execute the flow when the sensor readings indicate that the device is now in the desired position according to the configuration in the trigger.
The different behavior in face up/face down could be seen when the device sensor does not provide any values at all. This can happen on devices that don't provide sensor readings when the device is lying on a table without any movements. Slightly moving the device or tapping on the screen could be enough to make the sensor provide readings which should then trigger the trigger.

Regards,
Martin

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

Re: Device orientation (face down) bug

Post by Desmanto » 02 Nov 2017 12:11

At mine, face up on table, flow enabled > it will trigger immediately. I think it should be the default behaviour. Any other position also triggered immediately as soon as it is enabled and in the correct position, including the negate version.

The reason maybe just like what Martin said. When you put it above your head and phone face down, the phone will shake a bit, which invoke the sensor reading. Try to use another flow, put sleep 5 seconds, add action to enable this flow. Execute it and put your phone on table but face down (so you won't shake it). See if the flow get triggered immediately or not.
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.

Post Reply