ComposerClient 2.4: Clean cache on hotplug

On subsequent hotplug connected event for a display
SurfaceFlinger destroys the previous framebuffers and
recreates them. When the new buffers are created
ComposerClient still holds a handle to the old buffers and
they are not destroyed. This way the new framebuffers
may get allocated on non continuous memory causing garbled
screens for the user.

This is already implemented for ComposerClient 2.1-2.3. In
this CL only the behavior for ComposerClient 2.4 is changed.

Test: manually flash a device
Bug: 178785393
Change-Id: I6aa1243d61676c0a3d42cb7aecf19e6f8802cb1a
2 files changed