am b710a50a: Merge "fix [3452750] Issue 14634: SensorManager.getRotationMatrixFromVector gets NaN-Values [external] [DO NOT MERGE]" into gingerbread

* commit 'b710a50ab6ca36b502f548e8551f620e98bbb1d8':
  fix [3452750] Issue 14634: SensorManager.getRotationMatrixFromVector gets NaN-Values [external] [DO NOT MERGE]
This commit is contained in:
Mathias Agopian
2011-03-09 16:57:32 -08:00
committed by Android Git Automerger

View File

@ -1970,7 +1970,8 @@ public class SensorManager
if (rotationVector.length == 4) { if (rotationVector.length == 4) {
q0 = rotationVector[3]; q0 = rotationVector[3];
} else { } else {
q0 = (float)Math.sqrt(1 - q1*q1 - q2*q2 - q3*q3); q0 = 1 - q1*q1 - q2*q2 - q3*q3;
q0 = (q0 > 0) ? (float)Math.sqrt(q0) : 0;
} }
float sq_q1 = 2 * q1 * q1; float sq_q1 = 2 * q1 * q1;