android5.1设置默认开机横屏

1、进入framework/base/core/res/res/values/config.xml
    修改config_lidOpenRotation = 0 ;---->  config_lidOpenRotation  = 90 ;
2、进入framework/base/services/core/java/com/android/server/wm/WindowMangerService.java
    修改int mRotation = 0 ;-----> int mRotation = 1 ;
3、 进入framework/base/services/surfaceflinger/DisplayDevice.cpp
    修改setProjection(Displaystate::eOrientationDefault, mViewprot ,mFrame )------>
    setProjection( Displaystate::eOrientation90 ,mViewprot , mFrame  )
编译成功刷入系统会出现开机动画部分只显示3/4解决方案如下:
1、进入framework/base/cmds/bootanimation/BootAnimation.cpp
    修改status_t   BootAnimation::readyToRun函数中的                                                        
  spcontrol=session()-   >createsurface(String8("BootAnimation"),dinfo.w,dinfo.h.PIXEL_FORMAT_RGB_565);   
 为:
  spcontrol=session()-   >createsurface(String8"BootAnimation"),dinfo.h,dinfo.w.PIXEL_FORMAT_RGB_565);
2、进入/framework/native/services/surfaceflinger/DisplayDevice.cpp
   修改函数 void DisplayDevice::setProjection(intorientation, conts Rect&newViewport,constRect&newFrame)中
if(!frame.isValid()){
frame = Rect(w,h);----->frame = Rect(h,w);
}
    在Transform R;  下面添加
    orientation = DisplayState::eorientation90;
3、 进入/framework/native/services/surfaceflinger/surfaceFlinger.cpp
    修改函数voidSurfaceFlinger::onInitializeDisplay()中:
d.orientation = DisplayState::eOrientationDefault ;-----> d.orientation=DisplayState::eOrientatio90;

最后编译生成镜像,问题解决。 


转载自http://weibo.com/p/230418142aca4390102x6e4

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值