diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-07-28 19:49:43 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-28 19:49:43 +0000 |
commit | 4d9f5c91aeb7ab1ab9828bce45d5f0a7c3ba0716 (patch) | |
tree | 9990bffd354a2975eb83d80a771404e316b70535 /src/com/android/settings/applications | |
parent | 730389bd82247a5e92d360a8bb0f5b4f1ded97c2 (diff) | |
parent | e32c17580e5ca3d985204495640c9096f1bde856 (diff) | |
download | packages_apps_Settings-4d9f5c91aeb7ab1ab9828bce45d5f0a7c3ba0716.zip packages_apps_Settings-4d9f5c91aeb7ab1ab9828bce45d5f0a7c3ba0716.tar.gz packages_apps_Settings-4d9f5c91aeb7ab1ab9828bce45d5f0a7c3ba0716.tar.bz2 |
Merge "Don't use screenshot if structure is disabled (2/2)" into mnc-dev
Diffstat (limited to 'src/com/android/settings/applications')
-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() { |