Currently the layout method is called in some places of handleDPIchange methods. Since, DPI change is handled asyncly now, this might have an adverse effect on calling layout in handleDPIChange because layout depends on the size of the children which is sometimes cached. In an asynchronous setting, this might break the state as the children might not have scaled at the time layout is called in handleDPIChange.
Analyze, why layout is used in handleDPIChange and if it can be avoided. Also, check for any indirect calls to layout from the other methods called in handleDPIChange and its effects on scaling.