[MTE] disable dev option if security setting is on
Test: make RunSettingsRoboTests check dev settings manually Bug: 245624194 Change-Id: I3d9c9b89cd5483eee9800077943b1c30738e4c16
This commit is contained in:
@@ -21,8 +21,10 @@ import android.text.TextUtils;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.security.MemtagHelper;
|
||||
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
|
||||
|
||||
public class RebootWithMtePreferenceController extends DeveloperOptionsPreferenceController
|
||||
@@ -43,6 +45,20 @@ public class RebootWithMtePreferenceController extends DeveloperOptionsPreferenc
|
||||
return android.os.SystemProperties.getBoolean("ro.arm64.memtag.bootctl_supported", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
if (MemtagHelper.isChecked()) {
|
||||
return mContext.getResources().getString(R.string.reboot_with_mte_already_enabled);
|
||||
}
|
||||
return mContext.getResources().getString(R.string.reboot_with_mte_summary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
preference.setEnabled(!MemtagHelper.isChecked());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return KEY_REBOOT_WITH_MTE;
|
||||
|
Reference in New Issue
Block a user