SF: tune infrequent layers for animations

Classify a layer as frequent or not based the last buffer pattern.
When unknown (e.g. the first buffer after inactivity), return
the last known state of the layer. This change helps to correctly classify
animating layers that were inactive and now posts the first buffer.

Bug: 264952266
Test: atest libsurfaceflinger_unittest
Change-Id: Ie6a1a21c00f7bb58468da033e98d5e35eb0c4c8d
3 files changed