Android rotates LCD (안드로이드 화면 돌리기)
Android :
2009. 9. 26. 14:38
반응형
- /*
- public int rotationForOrientationLw(int orientation, int lastRotation,
- boolean displayEnabled) {
- synchronized (mLock) {
- switch (orientation) {
- case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
- //always return landscape if orientation set to landscape
- return Surface.ROTATION_90;
- case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
- //always return portrait if orientation set to portrait
- return Surface.ROTATION_0;
- }
- // case for nosensor meaning ignore sensor and consider only lid
- // or orientation sensor disabled
- //or case.unspecified
- if (mLidOpen) {
- return Surface.ROTATION_90;
- } else {
- if (useSensorForOrientationLp(orientation)) {
- // If the user has enabled auto rotation by default, do it.
- int curRotation = mOrientationListener.getCurrentRotation();
- return curRotation >= 0 ? curRotation : lastRotation;
- }
- return Surface.ROTATION_0;
- }
- }
- }
- */
- public int rotationForOrientationLw(int orientation, int lastRotation,
- boolean displayEnabled) {
- synchronized (mLock) {
- switch (orientation) {
- case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
- //always return landscape if orientation set to landscape
- return Surface.ROTATION_90;
- case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
- //always return portrait if orientation set to portrait
- return Surface.ROTATION_90;
- }
- // case for nosensor meaning ignore sensor and consider only lid
- // or orientation sensor disabled
- //or case.unspecified
- if (mLidOpen) {
- return Surface.ROTATION_90;
- } else {
- if (useSensorForOrientationLp(orientation)) {
- // If the user has enabled auto rotation by default, do it.
- int curRotation = mOrientationListener.getCurrentRotation();
- return curRotation >= 0 ? curRotation : lastRotation;
- }
- return Surface.ROTATION_90;
- }
- }
- }
frameworks/policies/base/phone/com/android/internal/policy/impl/PhoneWindowManager.java 에서 고치면 된다.
반응형
'Android' 카테고리의 다른 글
Android wifi Porting (0) | 2009.10.01 |
---|---|
Android용 busybox (0) | 2009.09.26 |
Camera 와 Framebuffer. (FakeCamera 수정) (0) | 2009.09.26 |