summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2015-06-15 23:49:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-15 23:49:19 +0000
commitbada978ec3eab48564c29eb4f8169e88975a2da0 (patch)
tree6079e973f3fba6455391dc505909cb21186fadd1
parentbe1b22e88ee24a9d53c1871da360cf7b56f4da0b (diff)
parentb627370e85bd6dec1a0e6379b0080036f21ae151 (diff)
downloadpackages_apps_Settings-bada978ec3eab48564c29eb4f8169e88975a2da0.tar.gz
packages_apps_Settings-bada978ec3eab48564c29eb4f8169e88975a2da0.tar.bz2
packages_apps_Settings-bada978ec3eab48564c29eb4f8169e88975a2da0.zip
Merge "Use AssistUtils.getAssistInfo" into mnc-dev
-rw-r--r--src/com/android/settings/applications/DefaultAssistPreference.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/settings/applications/DefaultAssistPreference.java b/src/com/android/settings/applications/DefaultAssistPreference.java
index 260d4b972..0bd729e7b 100644
--- a/src/com/android/settings/applications/DefaultAssistPreference.java
+++ b/src/com/android/settings/applications/DefaultAssistPreference.java
@@ -21,15 +21,15 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
+import android.os.UserHandle;
import android.provider.Settings;
import android.service.voice.VoiceInteractionService;
import android.service.voice.VoiceInteractionServiceInfo;
import android.speech.RecognitionService;
import android.util.AttributeSet;
import android.util.Log;
-import android.view.View;
-import android.view.ViewGroup;
+import com.android.internal.app.AssistUtils;
import com.android.settings.AppListPreferenceWithSettings;
import com.android.settings.R;
@@ -42,10 +42,13 @@ public class DefaultAssistPreference extends AppListPreferenceWithSettings {
private final List<Info> mAvailableAssistants = new ArrayList<>();
+ private final AssistUtils mAssistUtils;
+
public DefaultAssistPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setShowItemNone(true);
setDialogTitle(R.string.choose_assist_title);
+ mAssistUtils = new AssistUtils(context);
}
@Override
@@ -169,9 +172,7 @@ public class DefaultAssistPreference extends AppListPreferenceWithSettings {
}
public ComponentName getCurrentAssist() {
- String currentSetting = Settings.Secure.getString(getContext().getContentResolver(),
- Settings.Secure.ASSISTANT);
- return currentSetting == null ? null : ComponentName.unflattenFromString(currentSetting);
+ return mAssistUtils.getAssistComponentForUser(UserHandle.myUserId());
}
public void refreshAssistApps() {