Now using the gravity sensor to detect device orientation instead of the orientation vector sensor.