Changes to recovery

The AOSP recovery code can work quite well on VirtualBox. There is only an issue related to the display. To fix the display issue, we need to change two files in the recovery source code.

We use the RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER macro as we mentioned earlier to configure the frame buffer changes. We need to add it to the recovery Makefile minui/Android.mk first as follows:

ifeq ($(RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER), true) 
LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER
endif

Since double buffer cannot work well on VirtualBox for the time being, we have to disable it as follows:

... 
/* check if we can use double buffering */
#ifndef RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER
if (vi.yres * fi.line_length * 2 <= fi.smem_len) {
double_buffered = true;

memcpy(gr_framebuffer+1, gr_framebuffer, sizeof(GRSurface));
gr_framebuffer[1].data = gr_framebuffer[0].data +
gr_framebuffer[0].height * gr_framebuffer[0].row_bytes;

gr_draw = gr_framebuffer+1;

} else {
#else
{
printf("RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER := true ");
#endif
double_buffered = false;

gr_draw = (GRSurface*) malloc(sizeof(GRSurface));
memcpy(gr_draw, gr_framebuffer, sizeof(GRSurface));
gr_draw->data = (unsigned char*) malloc(gr_draw->height *
gr_draw->row_bytes);
if (!gr_draw->data) {
perror("failed to allocate in-memory surface");
return NULL;
}
}
...
With a similar change to TWRP, TWRP can be built for x86vbox as well. The branch for building TWRP is included in the source code at GitHub and you can try it yourself.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.107.255