Disable MTE developer option if device config overrides it

On the backend, the device config would already override the setting by
the UI.

(cherry picked from commit 65116faa29)

Bug: 269523554
Merged-In: Idd249e060a275b58a399349f202fc68b42964eb0
Change-Id: Idd249e060a275b58a399349f202fc68b42964eb0
This commit is contained in:
Florian Mayer
2023-02-15 16:22:11 -08:00
parent 6e6b067863
commit 9d99ab422a
3 changed files with 17 additions and 2 deletions

View File

@@ -48,6 +48,9 @@ public class DevelopmentMemtagPreferenceController extends TogglePreferenceContr
@Override
public int getAvailabilityStatus() {
if (MemtagHelper.isForcedOff() || MemtagHelper.isForcedOn()) {
return BasePreferenceController.DISABLED_DEPENDENT_SETTING;
}
return DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)
&& SystemProperties.getBoolean("ro.arm64.memtag.bootctl_supported", false)
? BasePreferenceController.AVAILABLE