am ce22d608: Merge "allow all 4 orientations" into gingerbread

* commit 'ce22d608733953e367a590efd9c7656a68ffc24d':
  allow all 4 orientations
This commit is contained in:
Hiroshi Lockheimer
2010-11-05 13:58:04 -07:00
committed by Android Git Automerger

View File

@@ -111,6 +111,7 @@ import android.view.animation.AnimationUtils;
import android.media.IAudioService;
import android.media.AudioManager;
import java.io.File;
import java.util.ArrayList;
/**
@@ -2114,8 +2115,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return getCurrentPortraitRotation(lastRotation);
}
mOrientationListener.setAllow180Rotation(
orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
if (new File("/system/etc/allow_all_orientations").exists()) {
mOrientationListener.setAllow180Rotation(true);
} else {
mOrientationListener.setAllow180Rotation(
orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
}
// case for nosensor meaning ignore sensor and consider only lid
// or orientation sensor disabled