主题 : Tiny 4412屏幕默认旋转180度的问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 102421
精华: 0
发帖: 2
金钱: 10 两
威望: 2 点
贡献值: 0 点
综合积分: 4 分
注册时间: 2014-03-31
最后登录: 2018-09-18
楼主  发表于: 65天前

 Tiny 4412屏幕默认旋转180度的问题

硬件环境:Tiny 4412增强版带7寸LCD模组
软件环境:Android 5.0.2

感觉默认的Android显示角度与LCD的可视角最大角度是反的,不爽,于是想让Android启动后与默认的显示角度旋转180度。
修改如下:
2. 修改WMS的默认方向。
/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.Java
int mRotation = 2;
3. 底层(C++)修改:frameworks/native/services/surfaceflinger/DisplayDevice.cpp
setProjection(DisplayState::eOrientation180, mViewport, mFrame);

uint32_t DisplayDevice::getOrientationTransform() const {
    uint32_t transform = 0;
    switch (mOrientation) {
        case DisplayState::eOrientationDefault:
            transform = Transform::ROT_180;
            break;
        case DisplayState::eOrientation90:
            transform = Transform::ROT_90;
            break;
        case DisplayState::eOrientation180:
            transform = Transform::ROT_180;
            break;
        case DisplayState::eOrientation270:
            transform = Transform::ROT_270;
            break;
    }
    return transform;
}

status_t DisplayDevice::orientationToTransfrom(
        int orientation, int w, int h, Transform* tr)
{
    uint32_t flags = 0;
    switch (orientation) {
    case DisplayState::eOrientationDefault:
        flags = Transform::ROT_180;
        break;
    case DisplayState::eOrientation90:
        flags = Transform::ROT_90;
        break;
    case DisplayState::eOrientation180:
        flags = Transform::ROT_180;
        break;
    case DisplayState::eOrientation270:
        flags = Transform::ROT_270;
        break;
    default:
        return BAD_VALUE;
    }
    tr->set(flags, w, h);
    return NO_ERROR;
}


现在的问题是:LCD的显示在启动后默认旋转了180度,但触屏的角度不知修改哪里才能也默认旋转180度。改了Inputreader.cpp里面,都无效。
求大神指教,谢谢!