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

Commit b32d8426 authored by Florian Mayer's avatar Florian Mayer
Browse files

[MTE] do not show notification for persistent MTE

Depends on https://r.android.com/2224809, but does not harm
(but doesn't work) if submitted earlier.

Test: mte on in bootloader, boot, no notification
Change-Id: Id1e6903d658e5fc83caea2710b4ae7559e455cce
parent 14ae6ce1
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -5329,7 +5329,14 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    private void showMteOverrideNotificationIfActive() {
        if (!SystemProperties.getBoolean("ro.arm64.memtag.bootctl_supported", false)
        String bootctl = SystemProperties.get("arm64.memtag.bootctl");
        // If MTE is on, there is one in three cases:
        // * a fullmte build: ro.arm64.memtag.bootctl_supported is not set
        // * memtag: arm64.memtag.bootctl contains "memtag"
        // * memtag-once
        // In the condition below we detect memtag-once by exclusion.
        if (Arrays.asList(bootctl.split(",")).contains("memtag")
            || !SystemProperties.getBoolean("ro.arm64.memtag.bootctl_supported", false)
            || !com.android.internal.os.Zygote.nativeSupportsMemoryTagging()) {
            return;
        }