foreword
In Android 12, RootWindowContainer is an important class, which is one of the main components of WindowManagerService, which is used to manage the windows of all applications. It represents the topmost container on the entire screen, including the status bar, navigation bar, and all application windows.
1. The creation of RootWindowContainer
1. RootWindowContainer is created in the constructor of WindowManagerService.
frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
public class WindowManagerService extends IWindowManager.Stub
implements Watchdog.Monitor, WindowManagerPolicy