How does the android graphics stack work?
Android doesn't use X,
although there is a Java implimentation of X made for Android android-xserver.
Instead of X, Android relies on the SurfaceFlinger and HWC(Hardware Composer),
working with the BufferQueue.