I cannot find any information on this when I search for it, so I figured I would ask here. I'm curious about the process by which an Android device is updated. Are system updates written to a location in the internal memory that the bootloader reads them from? Or does the kernel overwrite the boot and system partitions while running in RAM? How are downgrades prevented from occurring? By way of a counter that is stored somewhere in the internal memory?