am ea53bfcd: am d9bd96b3: Add setting to disable screenshot separately (2/2)

* commit 'ea53bfcddf8c8b37a154bcbdcbbec2ee71b109d9':
  Add setting to disable screenshot separately (2/2)
This commit is contained in:
Jorim Jaggi
2015-06-30 00:49:24 +00:00
committed by Android Git Automerger
3 changed files with 26 additions and 1 deletions

View File

@@ -38,10 +38,12 @@ public class ManageAssist extends SettingsPreferenceFragment
private static final String KEY_DEFAULT_ASSIST = "default_assist";
private static final String KEY_CONTEXT = "context";
private static final String KEY_SCREENSHOT = "screenshot";
private static final String KEY_VOICE_INPUT = "voice_input_settings";
private DefaultAssistPreference mDefaultAssitPref;
private SwitchPreference mContextPref;
private SwitchPreference mScreenshotPref;
private VoiceInputListPreference mVoiceInputPref;
@Override
@@ -57,6 +59,11 @@ public class ManageAssist extends SettingsPreferenceFragment
Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1) != 0);
mContextPref.setOnPreferenceChangeListener(this);
mScreenshotPref = (SwitchPreference) findPreference(KEY_SCREENSHOT);
mScreenshotPref.setChecked(Settings.Secure.getInt(getContentResolver(),
Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 1) != 0);
mScreenshotPref.setOnPreferenceChangeListener(this);
mVoiceInputPref = (VoiceInputListPreference) findPreference(KEY_VOICE_INPUT);
updateUi();
}
@@ -73,6 +80,11 @@ public class ManageAssist extends SettingsPreferenceFragment
(boolean) newValue ? 1 : 0);
return true;
}
if (preference == mScreenshotPref) {
Settings.Secure.putInt(getContentResolver(), Settings.Secure.ASSIST_SCREENSHOT_ENABLED,
(boolean) newValue ? 1 : 0);
return true;
}
if (preference == mDefaultAssitPref) {
String newAssitPackage = (String)newValue;
if (newAssitPackage == null ||