summaryrefslogtreecommitdiffstats
path: root/tools/orientationplot
Commit message (Collapse)AuthorAgeFilesLines
* Prevent unintended rotations.Jeff Brown2011-09-231-78/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 4981385 Changed the orientation listener to notify the policy whenever its proposed orientation changes, and changes the window manager to notify the orientation listener when the actual orientation changes. This allows us to better handle the case where the policy has rejected a given proposal at one time (because the current application forced orientation) but might choose to accept the same proposal at another time. It's important that the proposal always be up to date. A proposal becomes irrelevant as soon as the phone posture changes such that we can no longer determine the orientation with confidence (such as when a device is placed flat on a table). Simplified the orientation filtering. Now we just wait 200ms for the device to be still before issuing a proposal. The idea is that if the device is moving around a lot, we assume that the device is being picked up or put down or otherwise in the process of being moved. We don't want to change the rotation until that's all settled down. However, we do want to tolerate a certain amount of environmental noise. (The previous confidence algorithm was also designed along these lines but it was less direct about waiting for things to settle. Instead it simply made orientation changes take longer than usual while unsettled, but the extra delay was often too much or too little. This one should be easier to tune.) Change-Id: I09e6befea1f0994b6b15d424f3182859c0d9a530
* New orientation listener.Jeff Brown2011-01-242-0/+538
The objective in this listener is to be more careful about the signal processing to prevent spurious orientation changes and to make all of the tweakable factors physically meaningful. The calibration is defined in terms of time constants and does not assume a particular discrete sampling rate. This is useful because it allows us to change the accelerometer sampling interval if desired without having to change the calibration. Moreover, the accelerometer sampling interval can vary +/- 20ms from one sample to the next even in normal circumstances. Proposed orientation changes are weighted by confidence factors that vary exponentially in relation to how close the device is to the ideal orientation change posture (screen is vertical, angle is exactly at the midpoint of the orientation quadrant, and no external acceleration beside gravity). When not in an ideal posture, the device takes proportionally longer to settle into a new orientation state. Added a little tool to plot the log output of the WindowOrientationListener. Check the README for more information about how to use it. Change-Id: I787f02d03582ff26367df65eda8d9ce85c5cb343