diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-07-27 17:48:02 -0700 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2015-07-28 12:07:10 -0700 |
commit | e32c17580e5ca3d985204495640c9096f1bde856 (patch) | |
tree | f0d9e82f85dc57d928566ace497ca75b9151af60 /src/com | |
parent | 32b96646eec917987fdd38208c6b11a9bc8832d3 (diff) | |
download | packages_apps_Settings-e32c17580e5ca3d985204495640c9096f1bde856.zip packages_apps_Settings-e32c17580e5ca3d985204495640c9096f1bde856.tar.gz packages_apps_Settings-e32c17580e5ca3d985204495640c9096f1bde856.tar.bz2 |
Don't use screenshot if structure is disabled (2/2)
Bug: 22674955
Change-Id: I78208a4c746e3a501fe264918607ef94f64a8034
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/applications/ManageAssist.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/settings/applications/ManageAssist.java b/src/com/android/settings/applications/ManageAssist.java index de69bb6..f1d70ee 100644 --- a/src/com/android/settings/applications/ManageAssist.java +++ b/src/com/android/settings/applications/ManageAssist.java @@ -20,6 +20,7 @@ import android.app.AlertDialog; import android.content.ComponentName; import android.content.DialogInterface; import android.os.Bundle; +import android.os.Handler; import android.preference.Preference; import android.preference.SwitchPreference; import android.provider.Settings; @@ -45,6 +46,7 @@ public class ManageAssist extends SettingsPreferenceFragment private SwitchPreference mContextPref; private SwitchPreference mScreenshotPref; private VoiceInputListPreference mVoiceInputPref; + private Handler mHandler = new Handler(); @Override public void onCreate(Bundle icicle) { @@ -78,6 +80,7 @@ public class ManageAssist extends SettingsPreferenceFragment if (preference == mContextPref) { Settings.Secure.putInt(getContentResolver(), Settings.Secure.ASSIST_STRUCTURE_ENABLED, (boolean) newValue ? 1 : 0); + postUpdateUi(); return true; } if (preference == mScreenshotPref) { @@ -102,6 +105,15 @@ public class ManageAssist extends SettingsPreferenceFragment return false; } + private void postUpdateUi() { + mHandler.post(new Runnable() { + @Override + public void run() { + updateUi(); + } + }); + } + private void updateUi() { mDefaultAssitPref.refreshAssistApps(); mVoiceInputPref.refreshVoiceInputs(); @@ -122,6 +134,11 @@ public class ManageAssist extends SettingsPreferenceFragment getPreferenceScreen().addPreference(mVoiceInputPref); mVoiceInputPref.setAssistRestrict(currentAssist); } + + mScreenshotPref.setEnabled(mContextPref.isChecked()); + if (!mContextPref.isChecked()) { + mScreenshotPref.setChecked(false); + } } private boolean isCurrentAssistVoiceService() { |