[MTE] upgrade apps from async to sync mode on debug builds

These builds are slower anyway, as they enabled MTE sync mode (with
stack trace collection) on the whole platform. To make debugging easier,
also upgrade apps that enable MTE to sync mode.

Bug: 266056313
Test: app-memtag_async-release.apk crashes with MTESERR
Change-Id: I1d6d57c236a54cda2d5d61083f1bdf701c65185e
This commit is contained in:
Florian Mayer
2023-01-19 17:55:52 -08:00
parent e7a8a48ffe
commit 885bec8d86

View File

@@ -1328,6 +1328,15 @@ public final class Zygote {
level = MEMORY_TAG_LEVEL_NONE;
}
// If we requested "sync" mode for the whole platform, upgrade mode for apps that enable
// MTE.
// This makes debugging a lot easier.
if (level == MEMORY_TAG_LEVEL_ASYNC
&& (Build.IS_USERDEBUG || Build.IS_ENG)
&& "sync".equals(SystemProperties.get("persist.arm64.memtag.default"))) {
level = MEMORY_TAG_LEVEL_SYNC;
}
return level;
}