Skip to content
Commit dd4a748a authored by Charles Chen's avatar Charles Chen
Browse files

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
parent 0c8ec087
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment