[sf] fix snapshot updates for mirror layers

Ensure we update the mirrored snapshots when they are
created.

Test: atest CtsSurfaceControlTests
Bug: 238781169

Change-Id: I245702f8b521745ba59f0f993bcaef90d0cdbe9a
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 39f8307..bee89aa 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -5097,7 +5097,7 @@
                                           args.name, args.flags, -1 /* parentId */);
     }
 
-    {
+    if (mLegacyFrontEndEnabled) {
         std::scoped_lock<std::mutex> lock(mMirrorDisplayLock);
         mMirrorDisplays.emplace_back(layerStack, outResult.handle, args.client);
     }