RK3326 android10.0(Q) 横屏方案修改
开机logo横屏
U-boot logo 显示的两张图片是 kernel 根目录下的 logo.bmp 和 logo_kernel.bmp,如果
需要更换,用同名的**横屏 bmp **替换掉,重新编译 kernel
附:不一定要两张图片,可以只要一张,如果只有一张就保留 logo.bmp 这一张即可。
注:Android10.0的kernel.img和resource.img包含在boot.img中,更新编译kernel后需要在android根目
录下执行./mkimage.sh重新打包boot.img。打包后烧写rockdev下面的boot.img,即可查看效果。若烧录 kernel 文件夹下
的 boot.img,则设备无法正常开机。
开机动画横屏
修改 device/rockchip/common/BoardConfig.mk 中配置 BOOT_SHUTDOWN_ANIMATION_RINGING ?= true
制作资源图片均为横屏的开机动画,将开机动画.zip 复制到 device/rockchip/common/bootshutdown/bootanimation.zip (源码路径),
编译结束后会拷贝到 out 目录下 odm/media 中,烧写即可
Android 应用层显示横屏
device\rockchip\rk3326\BoardConfig.mk 中增加修改 SF_PRIMARY_DISPLAY_ORIENTATION := 90
搜索 SF_PRIMARY_DISPLAY_ORIENTATION 对应的文件,根据项目名称修改对应位置
./rockchip/common/device.mk:ifneq ($(filter 90 180 270, $(strip $(SF_PRIMARY_DISPLAY_ORIENTATION))), )
./rockchip/common/device.mk: ro.surface_flinger.primary_display_orientation=ORIENTATION_$(SF_PRIMARY_DISPLAY_ORIENTATION)
./rockchip/common/BoardConfig.mk:SF_PRIMARY_DISPLAY_ORIENTATION ?= 0
./rockchip/rk3368/BoardConfig.mk:SF_PRIMARY_DISPLAY_ORIENTATION := 0
./rockchip/rk3326/BoardConfig.mk:SF_PRIMARY_DISPLAY_ORIENTATION := 0
./rockchip/rk3126c/BoardConfig.mk:SF_PRIMARY_DISPLAY_ORIENTATION := 0
./rockchip/rk3399/BoardConfig.mk:SF_PRIMARY_DISPLAY_ORIENTATION := 0
./rockchip/rk3368a/BoardConfig.mk:SF_PRIMARY_DISPLAY_ORIENTATION := 0
TP坐标,交换 x y 坐标实现旋转
gtp_change_x2y:x、y交换方向
gtp_x_reverse:x 方向坐标镜像
gtp_y_reverse:y 方向不镜像
kernel\drivers\input\touchscreen\gt9xx\gt9xx.c
@@ -2656,9 +2656,13 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id
m89or101 = FALSE;
bgt911 = TRUE;
- gtp_change_x2y = FALSE;
- gtp_x_reverse = TRUE;
- gtp_y_reverse = TRUE;
+ //gtp_change_x2y = FALSE;
+ //gtp_x_reverse = TRUE;
+ //gtp_y_reverse = TRUE;
+
+ gtp_change_x2y = TRUE;
+ gtp_x_reverse = TRUE;
+ gtp_y_reverse = FALSE;
/*if (val == 89) {
m89or101 = TRUE;
RecoveryUI 横屏
rotation = GRRotation::LEFT; 270
rotation = GRRotation::DOWN; 180
rotation = GRRotation::RIGHT; 90
bootable\recovery\minui\graphics.cpp
int gr_init() {
.....
gr_backend = backend.release();
int overscan_percent = android::base::GetIntProperty("ro.minui.overscan_percent", 0);
overscan_offset_x = gr_draw->width * overscan_percent / 100;
overscan_offset_y = gr_draw->height * overscan_percent / 100;
gr_flip();
gr_flip();
if (!gr_draw) {
printf("gr_init: gr_draw becomes nullptr after gr_flip\n");
return -1;
}
std::string rotation_str =
android::base::GetProperty("ro.minui.default_rotation", "ROTATION_NONE");
if (rotation_str == "ROTATION_RIGHT") {
gr_rotate(GRRotation::RIGHT);
} else if (rotation_str == "ROTATION_DOWN") {
gr_rotate(GRRotation::DOWN);
} else if (rotation_str == "ROTATION_LEFT") {
gr_rotate(GRRotation::LEFT);
} else { // "ROTATION_NONE" or unknown string
gr_rotate(GRRotation::NONE);
}
rotation = GRRotation::RIGHT;
//cczheng add rotation = 1 for recoveryUI landscape
参考文章
[RK3399 Android9.0]强制旋转主屏幕方向](https://blog.csdn.net/weixin_39966398/article/details/105595184)
本文地址:https://blog.csdn.net/u012932409/article/details/107951773