Merge "Fix NPE if there is no accelerometer." into gingerbread

This commit is contained in:
Dianne Hackborn
2010-10-05 19:02:52 -07:00
committed by Android (Google) Code Review

View File

@@ -109,7 +109,9 @@ public abstract class WindowOrientationListener {
}
public void setAllow180Rotation(boolean allowed) {
mSensorEventListener.setAllow180Rotation(allowed);
if (mSensorEventListener != null) {
mSensorEventListener.setAllow180Rotation(allowed);
}
}
public int getCurrentRotation(int lastRotation) {