Revert "Revert "SF: opportunistically try to present the next vs..."

Revert submission 24994369-revert-24958537-b273702768-ERNZICNUUX

Reason for revert: Resubmit after fixing b/304324338

Reverted changes: /q/submissionid:24994369-revert-24958537-b273702768-ERNZICNUUX

Bug: 273702768
Change-Id: Icfb4cf6f69ae50f7bb0b5a185c9e68b43c946aa5
Test: manual
Test: presubmit
diff --git a/services/surfaceflinger/tests/unittests/Android.bp b/services/surfaceflinger/tests/unittests/Android.bp
index c99809b..91910c7 100644
--- a/services/surfaceflinger/tests/unittests/Android.bp
+++ b/services/surfaceflinger/tests/unittests/Android.bp
@@ -42,6 +42,13 @@
     ],
 }
 
+cc_aconfig_library {
+    name: "libsurfaceflingerflags_test",
+    aconfig_declarations: "surfaceflinger_flags",
+    // TODO(b/304338314): uncomment the below line once the bug is fixed
+    // test: true,
+}
+
 cc_test {
     name: "libsurfaceflinger_unittest",
     defaults: [
@@ -168,6 +175,7 @@
         "libtimestats_proto",
         "libtonemap",
         "perfetto_trace_protos",
+        "libsurfaceflingerflags_test",
     ],
     shared_libs: [
         "android.hardware.configstore-utils",