首页 > 代码库 > android4.0默认界面旋转180

android4.0默认界面旋转180

不巧新拿的android4.0默认启动画面和正常显示旋转了180度,即为倒立的。原来是屏输出为倒的,查找得知可以做旋转:

步骤:

一:先把这个加上 然后加上属性ro.sf.hwrotation = 180

二:在init.rc脚本中添加如下内容:      setprop ro.sf.hwrotation180

  1. 修改frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp文件,在voidGraphicPlane::setDisplayHardware(DisplayHardware*hw)函数中添加如下内容:

      case 180:

           displayOrientation =ISurfaceComposer::eOrientation180;

           break;
三:frameworks\base\services\java\com\android\server\wm\ScreenRotationAnimation.java

// Screenshot does NOT include rotation!
        mSnapshotRotation = (SystemProperties.getInt("ro.sf.hwrotation",0)==180)?2:0;
        //mSnapshotRotation = 0;

android4.0默认界面旋转180