How an Android Window Gets on Screen: WindowManager to SurfaceFlinger
Follow one addView() call from your app to the screen: Window and PhoneWindow, WindowManager and WindowManagerGlobal, ViewRootImpl, the Binder call into WindowManagerService, the WindowState it makes, and the later relayout that creates the surface. Read from AOSP main, with a step-by-step lab.