Merge "[MTE] support force_on for device_control override"
This commit is contained in:
committed by
Android (Google) Code Review
commit
3c0a0b82da
@@ -32,6 +32,13 @@ public class MemtagHelper {
|
||||
"persist.device_config.memory_safety_native.bootloader_override"));
|
||||
}
|
||||
|
||||
private static boolean isForcedOn() {
|
||||
return "force_on"
|
||||
.equals(
|
||||
SystemProperties.get(
|
||||
"persist.device_config.memory_safety_native.bootloader_override"));
|
||||
}
|
||||
|
||||
public static boolean isChecked() {
|
||||
String modes[] = SystemProperties.get("arm64.memtag.bootctl", "").split(",");
|
||||
return Arrays.asList(modes).contains("memtag");
|
||||
@@ -43,7 +50,7 @@ public class MemtagHelper {
|
||||
}
|
||||
|
||||
public static int getAvailabilityStatus() {
|
||||
if (MemtagHelper.isForcedOff()) {
|
||||
if (MemtagHelper.isForcedOff() || MemtagHelper.isForcedOn()) {
|
||||
return BasePreferenceController.DISABLED_DEPENDENT_SETTING;
|
||||
}
|
||||
return SystemProperties.getBoolean("ro.arm64.memtag.bootctl_settings_toggle", false)
|
||||
@@ -65,6 +72,9 @@ public class MemtagHelper {
|
||||
if (isForcedOff()) {
|
||||
return R.string.memtag_force_off;
|
||||
}
|
||||
if (isForcedOn()) {
|
||||
return R.string.memtag_force_on;
|
||||
}
|
||||
if (isOn()) {
|
||||
if (isChecked()) {
|
||||
return R.string.memtag_on;
|
||||
|
||||
Reference in New Issue
Block a user