From 730d1d5cd38d6a5b57343c0b8528130b98b8fce7 Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Tue, 25 Sep 2018 15:23:38 +0000 Subject: DO NOT MERGE: Add configurable default setting for assistant componentname By requiring an explicit default setting, it eliminates all ambiguous states where a disambiguation would normally be shown. With this change in place, at no point should a disambiguation be shown. Test: manual Bug: 111603898 Change-Id: Ib32dafbd3c6fcbe11186dc8ecab6b09c9b734067 --- core/java/com/android/internal/app/AssistUtils.java | 6 ++++++ core/res/res/values/config.xml | 4 ++++ core/res/res/values/symbols.xml | 2 ++ 3 files changed, 12 insertions(+) diff --git a/core/java/com/android/internal/app/AssistUtils.java b/core/java/com/android/internal/app/AssistUtils.java index 9171959537c8..4f742843eb12 100644 --- a/core/java/com/android/internal/app/AssistUtils.java +++ b/core/java/com/android/internal/app/AssistUtils.java @@ -152,6 +152,12 @@ public class AssistUtils { return ComponentName.unflattenFromString(setting); } + final String defaultSetting = mContext.getResources().getString( + R.string.config_defaultAssistantComponentName); + if (defaultSetting != null) { + return ComponentName.unflattenFromString(defaultSetting); + } + // Fallback to keep backward compatible behavior when there is no user setting. if (activeServiceSupportsAssistGesture()) { return getActiveServiceComponentName(); diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index db03eee26630..d6f0e913264a 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3521,4 +3521,8 @@ + + + + diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index eaaa86610f75..d893468a53f8 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3417,4 +3417,6 @@ + + -- cgit v1.2.3-59-g8ed1b