Add support for setting up userdata for automated testing
This only triggers when a special file in /data is placed which can be
flashed as part of the device setup in an automated environment.
It should not have any effect on phones that don't have this trigger.
Additionally,
* Adjust to Android 11: Migrate all changes from system/{core,sepolicy}
into one FP3 device change.
* Move to Android.bp.
Issue: FP3-A11#130
Change-Id: I0b86b95660e82a224848efa54e4aeceb4d05d802
(cherry picked from commit d92419520ea3507cbf4828dac01bfc7cefe70e41)
Depends-On: I780e7c112cc39251cb6af9781e8eab4f5aa95c6f
diff --git a/automation_setup/automation_setup.rc b/automation_setup/automation_setup.rc
new file mode 100644
index 0000000..4e54ab8
--- /dev/null
+++ b/automation_setup/automation_setup.rc
@@ -0,0 +1,15 @@
+#
+# Copyright 2021-2022 Fairphone B.V.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+on load_persist_props_action
+ start automation_setup
+
+service automation_setup /system/bin/automation_setup
+ user system
+ group root
+ stdio_to_kmsg
+ oneshot
+ disabled