Android 11.0 recovery竖屏界面旋转为横屏

在11.0项目开发中,由于平板固定横屏显示,而如果recovery界面竖屏显示就觉得怪怪的
所以今天就来解决这个问题

Android的Recovery中,利用 bootable\recovery下的minui库作为基础,采用的是直接存取framebuffer的方式,来完成recovery中所需的各种UI的绘制。

在recovery的源码中,跟ui显示相关的代码的大致结构为:

1 boottable/recovery下的 ui.h , ui.cpp, screen_ui.h,screen_ui.cpp,以及 mi_screen_ui.h,**_screen_ui.cpp,

2 boottable/recovery/minui下的resources.cpp,graphics.cpp

其中resources.cpp提供的api主要用于图片资源的读取和加载,graphics.cpp负责具体完成各类ui的绘制

既然graphics.cpp是负责各类UI的绘制 那么旋转方向的修改 就要从这里入手了
下面来看graphics.cpp的源码

#include "graphics.h"

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

猜你喜欢

转载自blog.csdn.net/baidu_41666295/article/details/124828181