Move initialization from onCreate to attachBaseContext
Previously we initialize WindowManager and associate DisplayArea in onCreate, but apps may use WindowManager before WindowProviderService#onCreate. The code may be like: ``` public void onCreate() { WindowManager wm = getSystemService(Windowmanager.class); wm.getCurrentWindowMetrics().getBounds(); // <--- crash here super.onCreate() ... } ``` This CL move the initialization step to attachBaseContext to prevent the crash. Test: atest WindowContextTests Test: run gsi_avd/boot_health/vendor_img_rvc on ABTD Bug: 191635763 Change-Id: Id8bad73a749813a90b307ac2b4d020f740631ea3
Loading
Please register or sign in to comment