반응형
  1. /* 
  2.     public int rotationForOrientationLw(int orientation, int lastRotation, 
  3.             boolean displayEnabled) { 
  4.         synchronized (mLock) { 
  5.             switch (orientation) { 
  6.                 case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE: 
  7.                     //always return landscape if orientation set to landscape 
  8.                     return Surface.ROTATION_90; 
  9.                 case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT: 
  10.                     //always return portrait if orientation set to portrait 
  11.                     return Surface.ROTATION_0; 
  12.             } 
  13.             // case for nosensor meaning ignore sensor and consider only lid 
  14.             // or orientation sensor disabled 
  15.             //or case.unspecified 
  16.             if (mLidOpen) { 
  17.                 return Surface.ROTATION_90; 
  18.             } else { 
  19.                 if (useSensorForOrientationLp(orientation)) { 
  20.                     // If the user has enabled auto rotation by default, do it. 
  21.                     int curRotation = mOrientationListener.getCurrentRotation(); 
  22.                     return curRotation >= 0 ? curRotation : lastRotation; 
  23.                 } 
  24.                 return Surface.ROTATION_0; 
  25.             } 
  26.         } 
  27.     } 
  28. */  
  29.     public int rotationForOrientationLw(int orientation, int lastRotation,  
  30.             boolean displayEnabled) {  
  31.         synchronized (mLock) {  
  32.             switch (orientation) {  
  33.                 case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:  
  34.                     //always return landscape if orientation set to landscape  
  35.                     return Surface.ROTATION_90;  
  36.                 case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:  
  37.                     //always return portrait if orientation set to portrait  
  38.                     return Surface.ROTATION_90;  
  39.             }  
  40.             // case for nosensor meaning ignore sensor and consider only lid  
  41.             // or orientation sensor disabled  
  42.             //or case.unspecified  
  43.             if (mLidOpen) {  
  44.                 return Surface.ROTATION_90;  
  45.             } else {  
  46.                 if (useSensorForOrientationLp(orientation)) {  
  47.                     // If the user has enabled auto rotation by default, do it.  
  48.                     int curRotation = mOrientationListener.getCurrentRotation();  
  49.                     return curRotation >= 0 ? curRotation : lastRotation;  
  50.                 }  
  51.                 return Surface.ROTATION_90;  
  52.             }  
  53.         }  
  54.     }  


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
Posted by Real_G