Settings.Secure.putInt(getContentResolver(), Settings.Secure.ASSIST_STRUCTURE_ENABLED,
(boolean) newValue ? 1 : 0);
mHandler.post(() -> {
- guardScreenshotPref();
guardFlashPref();
});
return true;
return false;
}
- private void guardScreenshotPref() {
- boolean isChecked = mContextPref.isChecked();
- boolean screenshotPrefWasSet = Settings.Secure.getInt(
- getContentResolver(), Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 1) != 0;
- mScreenshotPref.setEnabled(isChecked);
- mScreenshotPref.setChecked(isChecked && screenshotPrefWasSet);
- }
-
private void guardFlashPref() {
ComponentName assistant = mDefaultAssitPref.getCurrentAssist();
mVoiceInputPref.setAssistRestrict(currentAssist);
}
- guardScreenshotPref();
guardFlashPref();
}