Avoid configuration of callback being reset after relayout.
mPendingConfiguration is a parameter of IWindowSession.relayout. And IWindowSession.aidl declared "out Configuration outConfig", it will always create a new configuration for remote side to write. If remote side does not write (WMS does not have config change), the new default configuration will be returned. In original code passes mPendingConfiguration to updateConfiguration directly, then callbacks (sConfigCallbacks) receive the same instance of mPendingConfiguration. And because the implementation of callback may use the configuration after relayout has reset the configuration to default, then it may have timing that results "showing hybrid of portrait and landscape modes" which try to fix in commit e36d6e27. To avoid this, always create a copy to updateConfiguration. MSG_RESIZED_REPORT from dispatchResized also did the same thing. Related commit: e36d6e27 694f79b5 Change-Id: Ic1abd596e384918224b3a7020583d9a04641cccc
Loading
Please register or sign in to comment