[CrashRecovery] Refactor SystemProperties as api

As we cannot use SystemProperties.set outside the platform, refactoring
existing SystemProperties to sysprop api. This would provide better
structure and allow to continue using them from the new module.
This would not change any functionality.
More Details: go/android_sysprop_as_api

Bug: b/289203818
Test: m
Change-Id: I3cc61ecb6298ebb55100cb2f4d8d374a3f43d8f8
diff --git a/srcs/android/sysprop/CrashRecoveryProperties.sysprop b/srcs/android/sysprop/CrashRecoveryProperties.sysprop
new file mode 100644
index 0000000..c9aaa71
--- /dev/null
+++ b/srcs/android/sysprop/CrashRecoveryProperties.sysprop
@@ -0,0 +1,92 @@
+# Copyright (C) 2024 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module: "android.sysprop.CrashRecoveryProperties"
+owner: Platform
+
+prop {
+    api_name: "lastFactoryResetTimeMs"
+    type: Long
+    scope: Internal
+    access: ReadWrite
+    prop_name: "persist.crashrecovery.last_factory_reset"
+}
+
+# Below two properties track individual system server boot events, and are reset once the boot
+# threshold is met, or the boot loop trigger window is exceeded between boot events.
+prop {
+    api_name: "rescueBootStart"
+    type: Long
+    scope: Internal
+    access: ReadWrite
+    prop_name: "crashrecovery.rescue_boot_start"
+}
+
+prop {
+    api_name: "rescueBootCount"
+    type: Integer
+    scope: Internal
+    access: ReadWrite
+    prop_name: "crashrecovery.rescue_boot_count"
+}
+
+# Below two properties track multiple calls made to observers tracking boot loops. They are reset
+# when the de-escalation window is exceeded between boot events.
+prop {
+    api_name: "bootMitigationStart"
+    type: Long
+    scope: Internal
+    access: ReadWrite
+    prop_name: "crashrecovery.boot_mitigation_start"
+}
+
+prop {
+    api_name: "bootMitigationCount"
+    type: Integer
+    scope: Internal
+    access: ReadWrite
+    prop_name: "crashrecovery.boot_mitigation_count"
+}
+
+prop {
+    api_name: "attemptingReboot"
+    type: Boolean
+    scope: Internal
+    access: ReadWrite
+    prop_name: "crashrecovery.attempting_reboot"
+}
+
+prop {
+    api_name: "attemptingFactoryReset"
+    type: Boolean
+    scope: Internal
+    access: ReadWrite
+    prop_name: "crashrecovery.attempting_factory_reset"
+}
+
+prop {
+    api_name: "maxRescueLevelAttempted"
+    type: Integer
+    scope: Internal
+    access: ReadWrite
+    prop_name: "crashrecovery.max_rescue_level_attempted"
+}
+
+prop {
+    api_name: "enableRescueParty"
+    type: Boolean
+    scope: Internal
+    access: ReadWrite
+    prop_name: "persist.crashrecovery.enable_rescue"
+}