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:
e36d6e277e49475076b7872d36ea6a5c5b996e9d
694f79b5d1196640d1beb680b7d1fc68e6e77cbd

Change-Id: Ic1abd596e384918224b3a7020583d9a04641cccc
1 file changed