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

Commit 56167f56 authored by Florian Mayer's avatar Florian Mayer
Browse files

[MTE] Fix app_default property.

We would decide after checking for TBI, which is enabled for most apps.

Test: add log statement to the case, check it gets triggered
Bug: 216305376
Change-Id: I79bd9e932ad2fb75a3b68dfa062bb3433fe4784e
parent 26e6ae71
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1718,17 +1718,18 @@ public final class ProcessList {
            return Zygote.MEMORY_TAG_LEVEL_NONE;
        }

        // Check to see that the compat feature for TBI is enabled.
        if (mPlatformCompat.isChangeEnabled(NATIVE_HEAP_POINTER_TAGGING, app.info)) {
            return Zygote.MEMORY_TAG_LEVEL_TBI;
        }

        String defaultLevel = SystemProperties.get("persist.arm64.memtag.app_default");
        if ("sync".equals(defaultLevel)) {
            return Zygote.MEMORY_TAG_LEVEL_SYNC;
        } else if ("async".equals(defaultLevel)) {
            return Zygote.MEMORY_TAG_LEVEL_ASYNC;
        }

        // Check to see that the compat feature for TBI is enabled.
        if (mPlatformCompat.isChangeEnabled(NATIVE_HEAP_POINTER_TAGGING, app.info)) {
            return Zygote.MEMORY_TAG_LEVEL_TBI;
        }

        return Zygote.MEMORY_TAG_LEVEL_NONE;
    }