Add recovery support for perf experiments.

This change establishes a place for perf experiments and adds a
script to delay experiments for recovery purposes. For more info
see go/pixel-perf-experiment-whatif.

Bug: 365855872
Test: build/flash, set .Perf__experiments_delay_seconds=10, verify that vendor.perf.allow_experiments=1 after 10 seconds
Flag: NONE controlled by Mendel instead
Change-Id: I78db482542066d5d5646d8c303dbe88054cfe66d
Signed-off-by: Dmitry Skiba <dskiba@google.com>
diff --git a/performance/experiments/pixel-experiments-recovery.sh b/performance/experiments/pixel-experiments-recovery.sh
new file mode 100755
index 0000000..188222e
--- /dev/null
+++ b/performance/experiments/pixel-experiments-recovery.sh
@@ -0,0 +1,15 @@
+#!/vendor/bin/sh
+
+# This script delays experiments by the specified amount of seconds. The delay is not needed for
+# the normal operation, but becomes essential for the rare case (which "should not happen") where
+# an experiment causes really bad issues (e.g. crashes the kernel). In such case the delay gives
+# GMSCore an opportunity to fetch fresh experiments snapshot (with the bad experiment disabled).
+#
+# See go/pixel-perf-experiment-whatif for more info.
+
+delay_seconds="$1"
+
+if [ -n "$delay_seconds" ]; then
+    sleep "$delay_seconds"
+    /vendor/bin/setprop vendor.perf.allow_experiments 1
+fi