[QCM6125][Android13] 关闭救援模式

文章目录

    • 开发平台基本信息
    • 问题描述
    • 解决方法

开发平台基本信息

芯片: QCM6125
版本: Android 13
kernel: msm-4.14

问题描述

安装系统在未响应5分钟的时候,系统会自动进入救援模式,这时候需要通过音量键和电源键进行操作才能再次进入系统。对于无人值守的设备来说,救援模式是个很鸡肋的功能,所以,我们选择在系统中关闭救援模式。

解决方法

--- a/QSSI.13/bootable/recovery/recovery.cpp
+++ b/QSSI.13/bootable/recovery/recovery.cpp
@@ -749,7 +749,7 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri
         } else if (option == "locale" || option == "fastboot" || option == "reason") {
           // Handled in recovery_main.cpp
         } else if (option == "prompt_and_wipe_data") {
-          should_prompt_and_wipe_data = true;
+          should_prompt_and_wipe_data = false;
         } else if (option == "rescue") {
           rescue = true;
         } else if (option == "retry_count") {
--- a/QSSI.13/device/qcom/qssi/system.prop
+++ b/QSSI.13/device/qcom/qssi/system.prop
@@ -170,3 +170,8 @@ arm64.memtag.process.system_server=off
 
 # Disable blur on app launch
 ro.launcher.blur.appLaunch=0
+
+# common prop
+persist.sys.disable_rescue=true
+persist.sys.enable_rescue=false
--- a/QSSI.13/system/core/init/builtins.cpp
+++ b/QSSI.13/system/core/init/builtins.cpp
@@ -427,10 +427,10 @@ static Result<void> make_dir_with_options(const MkdirOptions& options) {
         }
     }
     if (fscrypt_is_native()) {
-        if (!FscryptSetDirectoryPolicy(ref_basename, options.fscrypt_action, options.target)) {
-            return reboot_into_recovery(
-                    {"--prompt_and_wipe_data", "--reason=set_policy_failed:"s + options.target});
-        }
+        // if (!FscryptSetDirectoryPolicy(ref_basename, options.fscrypt_action, options.target)) {
+        //     return reboot_into_recovery(
+        //             {"--prompt_and_wipe_data", "--reason=set_policy_failed:"s + options.target});
+        // }
     }
     return {};
 }
@@ -591,10 +591,11 @@ static Result<void> queue_fs_event(int code, bool userdata_remount) {
         /* Setup a wipe via recovery with prompt, and reboot into recovery if chosen */
         PLOG(ERROR) << "fs_mgr_mount_all suggested recovery, so wiping data via recovery "
                        "with prompt.";
-        const std::vector<std::string> options = {"--prompt_and_wipe_data",
-             "--reason=fs_mgr_mount_all" };
-        return reboot_into_recovery(options);
+        // const std::vector<std::string> options = {"--prompt_and_wipe_data",
+        //      "--reason=fs_mgr_mount_all" };
+        // return reboot_into_recovery(options);
         /* If reboot worked, there is no return. */
+        return {};
     } else if (code == FS_MGR_MNTALL_DEV_FILE_ENCRYPTED) {
         if (!FscryptInstallKeyring()) {
             return Error() << "FscryptInstallKeyring() failed";
@@ -1187,7 +1188,7 @@ static Result<void> ExecWithFunctionOnFailure(const std::vector<std::string>& ar
 }
 
 static Result<void> ExecVdcRebootOnFailure(const std::string& vdc_arg) {
-    bool should_reboot_into_recovery = true;
+    bool should_reboot_into_recovery = false;
     auto reboot_reason = vdc_arg + "_failed";
     if (android::sysprop::InitProperties::userspace_reboot_in_progress().value_or(false)) {
         should_reboot_into_recovery = false;



你可能感兴趣的:(Android13,救援模式,Android13,java,framework)