Prevent crash when manipulating hidden SurfaceView.

repositionChild was attempting to perform placement
transactions on hidden views (which do not have a Surface)
leading to an exception being thrown. Furthermore lack
of a finally block prevented an open transaction from
being closed while unwinding and rendered the system unuable.
First we avoid performing transactions on windows without services.
Second we correct flow to ensure transactions are closed in case
an exception was thrown for other reasons.

Bug: 25780116
Change-Id: If103158506298c8f5ec1b01d7e1c73e55427804a
1 file changed