SF: Fix a defect in the layer filtering logic

Change 32cbe2 broke the layer filtering logic when moving it over to
CompositionEngine. It would allow certain layers to appear on a virtual
display when they were supposed to be filtered out.

This corrects the logic to be what it was supposed to be, and adds a
unit test that verifies and documents the expected behavior.

Bug: 123248930
Test: atest libsurfaceflinger_unittest libcompositionengine_test
Test: atest android.media.cts.EncodeVirtualDisplayWithCompositionTest

Change-Id: Id2c4b4d32da405c64533924027795620f2d6ee61
10 files changed