Encapsulate excludeLayerId logic into a function

Logic duplicated in captureLayers and captureDisplay,
this is setup for moving more fields into screenshotArgs
in order to reduce stateLock contention.

Bug: b/377758217
Test: atest SurfaceFlinger_test
Test: atest CompositionTest
Test: atest RegionSamplingtest
Flag: EXEMPT, refactor
Change-Id: I5e693d918b9565c6e5680830286d28e8f4145c00
1 file changed