首页 > 其他分享 >T113启动G2D旋转竖屏当作横屏使用

T113启动G2D旋转竖屏当作横屏使用

时间:2024-11-11 17:29:55浏览次数:3  
标签:src addr dst bmp height width G2D 横屏 竖屏

在全志T113平台上,开发触摸屏的QT产品。基于成本选择了竖屏,但是产品是横屏形式。
QT应用竖屏转横屏可以走纯软件的实现,但是T113平台性能孱弱,使用纯软件实现UI操作不流畅,有卡顿现象。
全志T113有G2D模块,可以启用G2D旋转屏幕,减少CPU消耗,避免UI卡顿。
所以:

  1. 启用G2D旋转屏幕
  2. 旋转触摸驱动
  3. 修改开机LOGO显示,使uboot和linux中的logo显示一致

启用G2D旋转屏幕

linux配置

  • Device Drivers -> SUNXI G2D Driver -> sunxi g2d ratate module
  • Device Drivers -> Graphics support -> Frame buffer Devices -> DISP2 Framebuffer rotation support -> Hardware(G2D) rotation support

设备树修改

/*----------------------------------------------------------------------------------
disp init configuration

disp_mode             (0:screen0<screen0,fb0>)
screenx_output_type   (0:none; 1:lcd; 2:tv; 3:hdmi;5:vdpo)
screenx_output_mode   (used for hdmi output, 0:480i 1:576i 2:480p 3:576p 4:720p50)
                      (5:720p60 6:1080i50 7:1080i60 8:1080p24 9:1080p50 10:1080p60)
screenx_output_format (for hdmi, 0:RGB 1:yuv444 2:yuv422 3:yuv420)
screenx_output_bits   (for hdmi, 0:8bit 1:10bit 2:12bit 2:16bit)
screenx_output_eotf   (for hdmi, 0:reserve 4:SDR 16:HDR10 18:HLG)
screenx_output_cs     (for hdmi, 0:undefined  257:BT709 260:BT601  263:BT2020)
screenx_output_dvi_hdmi (for hdmi, 0:undefined 1:dvi mode 2:hdmi mode)
screen0_output_range   (for hdmi, 0:default 1:full 2:limited)
screen0_output_scan    (for hdmi, 0:no data 1:overscan 2:underscan)
screen0_output_aspect_ratio  (for hdmi, 8-same as original picture 9-4:3 10-16:9 11-14:9)
fbx format            (4:RGB655 5:RGB565 6:RGB556 7:ARGB1555 8:RGBA5551 9:RGB888 10:ARGB8888 12:ARGB4444)
fbx pixel sequence    (0:ARGB 1:BGRA 2:ABGR 3:RGBA)
fb0_scaler_mode_enable(scaler mode enable, used FE)
fbx_width,fbx_height  (framebuffer horizontal/vertical pixels, fix to output resolution while equal 0)
lcdx_backlight        (lcd init backlight,the range:[0,256],default:197
lcdx_yy               (lcd init screen bright/contrast/saturation/hue, value:0~100, default:50/50/57/50)
lcd0_contrast         (LCD contrast, 0~100)
lcd0_saturation       (LCD saturation, 0~100)
lcd0_hue              (LCD hue, 0~100)
framebuffer software rotation setting:
disp_rotation_used:   (0:disable; 1:enable,you must set fbX_width to lcd_y,
set fbX_height to lcd_x)
degreeX:              (X:screen index; 0:0 degree; 1:90 degree; 3:270 degree)
degreeX_Y:            (X:screen index; Y:layer index 0~15; 0:0 degree; 1:90 degree; 3:270 degree)
devX_output_type : config output type in bootGUI framework in UBOOT-2018.
				   (0:none; 1:lcd; 2:tv; 4:hdmi;)
devX_output_mode : config output resolution(see include/video/sunxi_display2.h) of bootGUI framework in UBOOT-2018
devX_screen_id   : config display index of bootGUI framework in UBOOT-2018
devX_do_hpd      : whether do hpd detectation or not in UBOOT-2018
chn_cfg_mode     : Hardware DE channel allocation config. 0:single display with 6
				   channel, 1:dual display with 4 channel in main display and 2 channel in second
                   display, 2:dual display with 3 channel in main display and 3 channel in second
                   in display.
----------------------------------------------------------------------------------*/
&disp {
	disp_init_enable         = <1>;
	disp_mode                = <0>;

	screen0_output_type      = <1>;
	screen0_output_mode      = <4>;

	screen1_output_type      = <1>;
	screen1_output_mode      = <4>;

	screen1_output_format    = <0>;
	screen1_output_bits      = <0>;
	screen1_output_eotf      = <4>;
	screen1_output_cs        = <257>;
	screen1_output_dvi_hdmi  = <2>;
	screen1_output_range     = <2>;
	screen1_output_scan      = <0>;
	screen1_output_aspect_ratio = <8>;

	dev0_output_type         = <1>;
	dev0_output_mode         = <4>;
	dev0_screen_id           = <0>;
	dev0_do_hpd              = <0>;

	dev1_output_type         = <4>;
	dev1_output_mode         = <10>;
	dev1_screen_id           = <1>;
	dev1_do_hpd              = <1>;

	def_output_dev           = <0>;
	hdmi_mode_check          = <1>;

	fb0_format               = <0>;
	fb0_width                = <800>;
	fb0_height               = <480>;

	disp_rotation_used       = <1>;
	degree0       			 = <3>;


	fb1_format               = <0>;
	fb1_width                = <0>;
	fb1_height               = <0>;
	chn_cfg_mode             = <1>;

	disp_para_zone           = <1>;
	/*VCC-LCD*/
/*	dc1sw-supply = <&reg_dc1sw>;*/
	/*VCC-DSI*/
/*	eldo3-supply = <&reg_eldo3>;*/
	/*VCC-PD*/
/*	dcdc1-supply = <&reg_dcdc1>;*/
};

需要添加和修改的地方就是

fb0_width                = <800>;
fb0_height               = <480>;
disp_rotation_used       = <1>;
degree0                  = <3>;

触摸驱动旋转

触摸启动修改只需要修改设备树

ctp@14 {
	compatible = "allwinner,goodix";
	device_type = "ctp";
	reg = <0x14>;
	status = "okay";
	ctp_name = "gt9xxnew_ts";
	ctp_twi_id = <0x2>;
	ctp_twi_addr = <0x14>;
	ctp_screen_max_x = <0x320>; /* 800 */
	ctp_screen_max_y = <0x1e0>; /* 400 */
	ctp_revert_x_flag = <0x1>;
	ctp_revert_y_flag = <0x0>;
	ctp_exchange_x_y_flag = <0x1>;
	ctp_int_port = <&pio PE 9 GPIO_ACTIVE_HIGH>;
	ctp_wakeup = <&pio PE 8 GPIO_ACTIVE_HIGH>;
	/*ctp-supply = <&reg_aldo2>;*/
	/*ctp_power_ldo = <&reg_aldo2>;*/
	/*ctp_power_ldo_vol = <3300>;*/
};

其中 ctp_revert_x_flagctp_exchange_x_y_flag是重点修改的地方。

如果你只修改了,以上两个功能,产品已经是横屏状态。但是,在开机logo阶段,由于uboot没有启用G2D功能,所有uboot阶段和linux阶段logo显示角度不一样。修改uboot和内核显示logo源码可以使得logo显示一致。事后,我发现,可以制作一个旋转后的logo图片,达到只修改uboot或者linux一处就可以了。

  1. uboot阶段旋转logo,
  2. linux反向旋转logo,防止二次旋转

U-Boot

uboot中修改的文件路径u-boot-2018/drivers/video/sunxi/logo_display/cmd_sunxi_bmp.crotateBMP90在屏幕上的效果是将bmp图片逆时针旋转了90度。

#pragma pack(push, 1)
typedef struct {
    uint16_t type;
    uint32_t size;
    uint16_t reserved1;
    uint16_t reserved2;
    uint32_t offset;
} BMPFileHeader;
#pragma pack(pop)

// 定义BMP图像信息头结构体
#pragma pack(push, 1)
typedef struct {
    uint32_t header_size;
    int32_t width;
    int32_t height;
    uint16_t planes;
    uint16_t bit_count;
    uint32_t compression;
    uint32_t image_size;
    int32_t x_pixels_per_meter;
    int32_t y_pixels_per_meter;
    uint32_t colors_used;
    uint32_t colors_important;
} BMPInfoHeader;
#pragma pack(pop)

void rotateBMP90(char* bmp_head_add)
{
    // 读取文件头
    BMPFileHeader* file_header = (BMPFileHeader*)bmp_head_add;

    // 读取图像信息头
    BMPInfoHeader* info_header = (BMPInfoHeader*)(bmp_head_add + sizeof(BMPFileHeader));

    // 获取图像宽度、高度和每行像素所占字节数
    int32_t width = info_header->width;
    int32_t height = info_header->height;
    uint32_t row_size = (info_header->bit_count * width + 31) / 32 * 4;

    if (info_header->compression == 0) {
        info_header->image_size = row_size * height;
    }

    // 分配内存来存储旋转后的图像数据
    uint8_t* rotated_data = (uint8_t*)malloc(info_header->image_size);

    // 旋转图像数据90度
    for (int32_t y = 0; y < height; y++) {
        for (int32_t x = 0; x < width; x++) {
            for (int32_t byte = 0; byte < row_size / width; byte++) {
                rotated_data[(x * height + (height - y - 1)) * (row_size / width) + byte] =
                    bmp_head_add[file_header->offset + (y * width + x) * (row_size / width) + byte];
            }
        }
    }

    // 更新图像信息头中的宽度和高度
    info_header->width = height;
    info_header->height = width;

	memcpy(bmp_head_add + file_header->offset, rotated_data, info_header->image_size);

    // 将旋转后的图像数据写入新的BMP文件
    //FILE* out_file = fopen("rotated_logo_270.bmp", "wb");
    // fwrite(file_header, sizeof(BMPFileHeader), 1, out_file);
    // fwrite(info_header, sizeof(BMPInfoHeader), 1, out_file);
    // fwrite(rotated_data, info_header->image_size, 1, out_file);

    // 释放内存并关闭文件
    free(rotated_data);
    // fclose(out_file);
}

int sunxi_bmp_display(char *name)
{
	int ret = -1;
	char *argv[6];
	char bmp_head[32];
	char bmp_name[32];
	char part_info[16] = {0};
	char size[32] = {0};
	int partno = -1;
	unsigned long file_size = 0;
	char *bmp_head_addr;
	struct bmp_image *bmp;
	bmp = memalign(CONFIG_SYS_CACHELINE_SIZE,  ALIGN(sizeof(struct bmp_header), CONFIG_SYS_CACHELINE_SIZE));
	if (bmp) {
		sprintf(bmp_head, "%lx", (ulong)bmp);
	} else {
		pr_error("sunxi bmp: alloc buffer for %s fail\n", name);
		goto out;
	}
	partno = sunxi_partition_get_partno_byname("bootloader"); /*android*/
	if (partno < 0) {
		partno = sunxi_partition_get_partno_byname(
		    "boot-resource"); /*linux*/
		if (partno < 0) {
			pr_error("Get bootloader and boot-resource partition number fail!\n");
			goto free1;
		}
	}
	snprintf(part_info, 16, "0:%x", partno);
	strncpy(bmp_name, name, sizeof(bmp_name));
	snprintf(size, 16, "%lx", (ulong)sizeof(struct bmp_header));

	argv[0] = "fatload";
	argv[1] = "sunxi_flash";
	argv[2] = part_info;
	argv[3] = bmp_head;
	argv[4] = bmp_name;
	argv[5] = size;

	if (do_fat_fsload(0, 0, 6, argv)) {
		pr_error("sunxi bmp info error : unable to open logo file %s\n",
		       argv[4]);
		goto free1;
	}
	if ((bmp->header.signature[0] != 'B') ||
	    (bmp->header.signature[1] != 'M')) {
		pr_error("this is not a bmp picture\n");
		goto free1;
	}
	file_size = bmp->header.file_size;

	bmp_head_addr = memalign(CONFIG_SYS_CACHELINE_SIZE,  ALIGN(file_size, CONFIG_SYS_CACHELINE_SIZE));
	if (bmp_head_addr) {
		sprintf(bmp_head, "%lx", (ulong)bmp_head_addr);
	} else {
		pr_error("sunxi bmp: alloc buffer for %s fail\n", name);
		goto free1;
	}

	snprintf(size, 16, "%lx", (ulong)file_size);

	tick_printf("bmp_name=%s size %ld\n", bmp_name, file_size);

	if (do_fat_fsload(0, 0, 6, argv)) {
		pr_error("sunxi bmp info error : unable to open logo file %s\n",
		       argv[4]);
		goto free2;
	}

	rotateBMP90(bmp_head_addr);

	ret = show_bmp_on_fb(bmp_head_addr, FB_ID_0);
	if (ret != 0)
		pr_error("show bmp on fb failed !%d\n", ret);

free2:
	free(bmp_head_addr);
free1:
	free(bmp);
out:
	return ret;
}

Linux

void rotateImage90(char* src_addr, int width, int height, int bpp, int stride) {
    // 计算每行像素数据的字节数
    int row_bytes = width * (bpp / 8);
    char * src_addr_e = src_addr + stride * height; // 最后的地址位置

    // 创建临时缓冲区用于保存旋转后的图像数据
    char* temp_data = (char*)vmalloc(row_bytes * height);
    int y = 0, x = 0;

    // 复制旋转后的图像数据到临时缓冲区
    for (y = 0; y < height; y++) {
        char* src_row_start = src_addr + (y * stride);
        for (x = 0; x < width; x++) {
            char* src_pixel = src_row_start + (x * (bpp / 8));
            char* dest_pixel = temp_data + (x * height + (height - 1 - y)) * (bpp / 8);
            // 复制像素值
            memcpy(dest_pixel, src_pixel, (bpp / 8));
        }
    }

    // 将旋转后的图像数据写回原始内存地址
    for (y = 0; y < width; y++) {
        char* dest_row_start = src_addr + (y * stride);
        char* src_row_start = temp_data + (y * height * (bpp / 8));
        memcpy(dest_row_start, src_row_start, height * (bpp / 8));
    }

    // 释放临时缓冲区
 	vfree(temp_data);
}

static int Fb_copy_boot_fb(u32 sel, struct fb_info *info)
{
	enum {
		BOOT_FB_ADDR = 0,
		BOOT_FB_WIDTH,
		BOOT_FB_HEIGHT,
		BOOT_FB_BPP,
		BOOT_FB_STRIDE,
		BOOT_FB_CROP_L,
		BOOT_FB_CROP_T,
		BOOT_FB_CROP_R,
		BOOT_FB_CROP_B,
	};

	char *boot_fb_str = NULL;
	char *src_phy_addr = NULL;
	char *src_addr = NULL;
	char *src_addr_b = NULL;
	char *src_addr_e = NULL;
	int src_width = 0;
	int src_height = 0;
	int fb_height = 0;
	int src_bpp = 0;
	int src_stride = 0;
	int src_cp_btyes = 0;
	int src_crop_l = 0;
	int src_crop_t = 0;
	int src_crop_r = 0;
	int src_crop_b = 0;

	char *dst_addr = NULL;
	int dst_width = 0;
	int dst_height = 0;
	int dst_bpp = 0;
	int dst_stride = 0;
	int ret;

	unsigned long map_offset;

	int tmp;

	if (info == NULL) {
		__wrn("%s,%d: null pointer\n", __func__, __LINE__);
		return -1;
	}

	boot_fb_str = (char *)disp_boot_para_parse_str("boot_fb0");
	if (boot_fb_str != NULL) {
		int i = 0;
		char boot_fb[128] = { 0 };
		int len = strlen(boot_fb_str);

		if (sizeof(boot_fb) - 1 < len) {
			__wrn("need bigger array size[%d] for boot_fb\n", len);
			return -1;
		}
		memcpy((void *)boot_fb, (void *)boot_fb_str, len);
		boot_fb[len] = '\0';
		boot_fb_str = boot_fb;
		for (i = 0;; ++i) {
			char *p = strstr(boot_fb_str, ",");

			if (p != NULL)
				*p = '\0';
			if (i == BOOT_FB_ADDR) {
				ret = kstrtoul(boot_fb_str, 16,
				    (unsigned long *)&src_phy_addr);
				if (ret)
					pr_warn("parse src_phy_addr fail!\n");
			} else if (i == BOOT_FB_WIDTH) {
				ret = kstrtou32(boot_fb_str, 16, &src_width);
				if (ret)
					pr_warn("parse src_width fail!\n");
			} else if (i == BOOT_FB_HEIGHT) {
				ret = kstrtou32(boot_fb_str, 16, &src_height);
				fb_height = src_height;
				if (ret)
					pr_warn("parse src_height fail!\n");
			} else if (i == BOOT_FB_BPP) {
				ret = kstrtou32(boot_fb_str, 16, &src_bpp);
				if (ret)
					pr_warn("parse src_bpp fail!\n");
			} else if (i == BOOT_FB_STRIDE) {
				ret = kstrtou32(boot_fb_str, 16, &src_stride);
				if (ret)
					pr_warn("parse src_stride fail!\n");
			} else if (i == BOOT_FB_CROP_L) {
				ret = kstrtou32(boot_fb_str, 16, &src_crop_l);
				if (ret)
					pr_warn("parse src_crop_l fail!\n");
			} else if (i == BOOT_FB_CROP_T) {
				ret = kstrtou32(boot_fb_str, 16, &src_crop_t);
				if (ret)
					pr_warn("parse src_crop_t fail!\n");
			} else if (i == BOOT_FB_CROP_R) {
				ret = kstrtou32(boot_fb_str, 16, &src_crop_r);
				if (ret)
					pr_warn("parse src_crop_r fail!\n");
			} else if (i == BOOT_FB_CROP_B) {
				ret = kstrtou32(boot_fb_str, 16, &src_crop_b);
				if (ret)
					pr_warn("parse src_crop_b fail!\n");
			} else {
				break;
			}

			if (p == NULL)
				break;
			boot_fb_str = p + 1;
		}
	} else {
		__wrn("no boot_fb0\n");
		return -1;
	}

	dst_addr = (char *)(info->screen_base);
	dst_width = info->var.xres;
	dst_height = info->var.yres;
	dst_bpp = info->var.bits_per_pixel;
	dst_stride = info->fix.line_length;

	if ((src_phy_addr == NULL)
	    || (src_width <= 0)
	    || (src_height <= 0)
	    || (src_stride <= 0)
	    || (src_bpp <= 0)
	    || (dst_addr == NULL)
	    || (dst_width <= 0)
	    || (dst_height <= 0)
	    || (dst_stride <= 0)
	    || (dst_bpp <= 0)
	    || (src_bpp != dst_bpp)) {
		__wrn
		    ("wrong para: src[phy_addr=%p,w=%d,h=%d,bpp=%d,stride=%d], dst[addr=%p,w=%d,h=%d,bpp=%d,stride=%d]\n",
		     src_phy_addr,
		     src_width, src_height, src_bpp, src_stride, dst_addr,
		     dst_width, dst_height, dst_bpp, dst_stride);
		return -1;
	}

	// rotateImage180(dst_addr, dst_width, dst_height, dst_bpp, dst_stride);

    tmp = dst_width;
    dst_width = dst_height;
    dst_height = tmp;

	map_offset = (unsigned long)src_phy_addr + PAGE_SIZE
	    - PAGE_ALIGN((unsigned long)src_phy_addr + 1);
	src_addr = (char *)Fb_map_kernel_cache((unsigned long)src_phy_addr -
					       map_offset,
					       src_stride * src_height +
					       map_offset);
	if (src_addr == NULL) {
		__wrn("Fb_map_kernel_cache for src_addr failed\n");
		return -1;
	}

	src_addr_b = src_addr + map_offset;
	if ((src_crop_b > src_crop_t) &&
	    (src_height > src_crop_b - src_crop_t) &&
	    (src_crop_t >= 0) &&
	    (src_height >= src_crop_b)) {
		src_height = src_crop_b - src_crop_t;
		src_addr_b += (src_stride * src_crop_t);
	}
	if ((src_crop_r > src_crop_l)
	    && (src_width > src_crop_r - src_crop_l)
	    && (src_crop_l >= 0)
	    && (src_width >= src_crop_r)) {
		src_width = src_crop_r - src_crop_l;
		src_addr_b += (src_crop_l * src_bpp >> 3);
	}
	if (src_height < dst_height) {
		int dst_crop_t = (dst_height - src_height) >> 1;

		dst_addr += (dst_stride * dst_crop_t);
	} else if (src_height > dst_height) {
		__wrn("src_height(%d) > dst_height(%d),please cut the height\n",
		      src_height,
		      dst_height);
		Fb_unmap_kernel(src_addr);
		return -1;
	}
	if (src_width < dst_width) {
		int dst_crop_l = (dst_width - src_width) >> 1;

		dst_addr += (dst_crop_l * dst_bpp >> 3);
	} else if (src_width > dst_width) {
		__wrn("src_width(%d) > dst_width(%d),please cut the width!\n",
		      src_width,
		      dst_width);
		Fb_unmap_kernel(src_addr);
		return -1;
	}
	src_cp_btyes = src_width * src_bpp >> 3;
	src_addr_e = src_addr_b + src_stride * src_height;
#if defined(CONFIG_ION)
	sunxi_ion_dma_buf_begin_cpu_access(g_fbi.mem[info->node]->p_item->dmabuf);
#endif
	for (; src_addr_b != src_addr_e; src_addr_b += src_stride) {
		memcpy((void *)dst_addr, (void *)src_addr_b, src_cp_btyes);
		dst_addr += dst_stride;
	}
	dst_addr = (char *)(info->screen_base);
	rotateImage90(dst_addr, dst_width, dst_height, dst_bpp, dst_stride);

#if defined(CONFIG_ION)
	sunxi_ion_dma_buf_end_cpu_access(g_fbi.mem[info->node]->p_item->dmabuf);
#endif
	Fb_unmap_kernel(src_addr);
	g_fbi.wait_for_free[sel] = true;
	//memblock_free((unsigned long)src_phy_addr, src_stride * fb_height);
	//free_reserved_area(__va(src_phy_addr), __va(src_phy_addr + PAGE_ALIGN(src_stride * fb_height)), 0x00, "logo buffer");
	return 0;
}

标签:src,addr,dst,bmp,height,width,G2D,横屏,竖屏
From: https://www.cnblogs.com/liamyi/p/18539667

相关文章

  • 竖屏短剧如何打造一站式短剧宣发营销变现平台?
       目前短剧市场历经野蛮混战后进入增速放缓的平稳发展期,未来5年市场规模有望突破千亿元。2023年短剧规划备案总量超2700部,上线备案数量近600部,同比增长率超100%。   当前,用户将短剧作为日常娱乐的重要选择之一,爱情、古装、都市、悬疑是他们的四大类型偏好。 ......
  • Android 14.0 recovery竖屏界面旋转为横屏
    1.概述在14.0系统rom项目定制化开发中,由于平板固定横屏显示,而如果recovery界面竖屏显示就觉得怪怪的,所以需要recovery页面横屏显示的功能,所以今天就来解决这个问题2.实现功能相关分析Android的Recovery中,利用bootable\recovery下的minui库作为基础,采用的是直接存取framebu......
  • HarmonyOS开发之横竖屏旋转适配
    场景描述在HarmonyOS移动应用开发中,横竖屏旋转适配成为了一个不可或缺的功能点。特别是在HarmonyOSNEXT平台,开发者面临着更加多样化的设备和更复杂的用户交互需求。以下是我们在项目中遇到的一些关于横竖屏旋转的高频问题及解决方案:如何通过传感器自己感知方向并设置旋转:在不考虑......
  • Android 10.0 mtk平板camera2横屏预览旋转90度横屏保存录像旋转90度功能实现
    1.前言在10.0的系统rom定制化开发中,在进行一些平板等默认横屏的设备开发的过程中,需要在进入camera2的时候,默认预览图像也是需要横屏显示的,在上一篇已经实现了横屏预览功能,然后发现横屏预览后,点击录像保存的视频依然是竖屏的,所以说同样需要将视频也保存为横屏视频了,所以就需......
  • [HarmonyOS Next示例代码]视频横竖屏切换
    HarmonyOS next示例代码全集HarmonyOS_Samples/LandscapePortraitToggle视频横竖屏切换介绍本示例实现了视频播放的横竖屏自动切换功能效果预览竖屏横屏使用说明1.下拉状态栏打开关闭“旋转锁定”开关,打开app进入视频播放详情页,旋转手机到横屏或者点击视频右下角......
  • ✨✨使用jq+layui的layer+laytpl实现横屏查看功能✨✨
    使用jq+layui的layer+laytpl实现横屏查看功能✨一、实现功能......
  • 横竖屏切换,按home键,按返回键,锁屏与解锁屏幕,跳转透明Activity界面,启动一个 Theme
    A->B横竖屏切换:A走完ondestory才会走B的onCreate--会走pause按home键:本质上就是普通开B按返回键:也是开B但是会走关A锁屏与解锁屏幕:普通跳转透明Activity界面:会走pause但是不会走onstop启动一个Theme为Dialog的Activity:会onPause不会stop弹出Dialog时A......
  • Android 12.0 MTK平台关机充电动画横屏显示修改
    1.前言在12.0的系统rom定制化开发中,在关于MTK平台的产品中,系统默认的充电动画是竖屏显示的,但是在像平板的产品中竖屏动画肯定不符合规范,所以需要在平板TV产品中,充电动画同时也是需要修改为横屏显示的,接下来就来分析下充电动画的相关绘制流程,然后实现功能2.MTK平台关机充电动......
  • 强制app横屏显示或者竖屏显示(动态)
    需求:某个app横屏显示不全,需要强制它竖屏显示,强制APP旋转优先级>系统方向优先级如果系统没有强制横竖屏,一般都是默认应用本身的方向设置!./frameworks/base/services/core/java/com/android/server/wm/DisplayRotation.javarotationForOrientation()和updateOrientation()来负责......
  • Android 12.0 展讯平台关机充电动画横屏显示修改
    1.前言在12.0的系统rom定制化开发中,在关于展讯平台的产品中,系统默认的充电动画是竖屏显示的,但是在像平板的产品中竖屏动画肯定不符合规范,所以需要在平板TV产品中,充电动画同时也是需要修改为横屏显示的,接下来就来分析下充电动画的相关绘制流程,然后实现功能2.展讯平台关机充电......