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

Commit 5197e972 authored by Florian Mayer's avatar Florian Mayer Committed by Automerger Merge Worker
Browse files

Merge "[MTE] Add device config to control upgrade time" am: 84a30c85 am: 04378de4

parents e6732f33 04378de4
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -340,9 +340,18 @@ void Service::Reap(const siginfo_t& siginfo) {
                              siginfo.si_status == BIONIC_SIGNAL_ART_PROFILER && !upgraded_mte_;

    if (should_upgrade_mte) {
        LOG(INFO) << "Upgrading service " << name_ << " to sync MTE";
        once_environment_vars_.emplace_back("BIONIC_MEMTAG_UPGRADE_SECS", "60");
        constexpr int kDefaultUpgradeSecs = 60;
        int secs = GetIntProperty("persist.device_config.memory_safety_native.upgrade_secs.default",
                                  kDefaultUpgradeSecs);
        secs = GetIntProperty(
                "persist.device_config.memory_safety_native.upgrade_secs.service." + name_, secs);
        if (secs > 0) {
            LOG(INFO) << "Upgrading service " << name_ << " to sync MTE for " << secs << " seconds";
            once_environment_vars_.emplace_back("BIONIC_MEMTAG_UPGRADE_SECS", std::to_string(secs));
            upgraded_mte_ = true;
        } else {
            LOG(INFO) << "Not upgrading service " << name_ << " to sync MTE due to device config";
        }
    }
#endif