Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6b2317d authored by Tom Cherry's avatar Tom Cherry Committed by android-build-merger
Browse files

Merge "init: do not load persistent properties from temporary /data" am: b1d93a81 am: b916f49b

am: ec9aa8ce

Change-Id: I893fcae4ba573b50d096d065eed2d6ec1ac47ad0
parents e7510599 ec9aa8ce
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -697,6 +697,17 @@ static void load_override_properties() {
 * has mounted /data.
 */
void load_persist_props(void) {
    // Devices with FDE have load_persist_props called twice; the first time when the temporary
    // /data partition is mounted and then again once /data is truly mounted.  We do not want to
    // read persistent properties from the temporary /data partition or mark persistent properties
    // as having been loaded during the first call, so we return in that case.
    std::string crypto_state = android::base::GetProperty("ro.crypto.state", "");
    std::string crypto_type = android::base::GetProperty("ro.crypto.type", "");
    if (crypto_state == "encrypted" && crypto_type == "block") {
        static size_t num_calls = 0;
        if (++num_calls == 1) return;
    }

    load_override_properties();
    /* Read persistent properties after all default values have been loaded. */
    load_persistent_properties();