summaryrefslogtreecommitdiffstats
path: root/services/voiceinteraction/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2014-11-14 10:55:50 -0800
committerDianne Hackborn <hackbod@google.com>2014-11-14 11:05:08 -0800
commitc0e4aaad1ecd5df2608f10a644f3d8f60056d94c (patch)
treef9ffaeedbafd4ba5927b58da5ee0e114127c77a6 /services/voiceinteraction/java
parent075b2b4ff9a9a96462a3102b54fdcabc6e5daf99 (diff)
downloadframeworks_base-c0e4aaad1ecd5df2608f10a644f3d8f60056d94c.zip
frameworks_base-c0e4aaad1ecd5df2608f10a644f3d8f60056d94c.tar.gz
frameworks_base-c0e4aaad1ecd5df2608f10a644f3d8f60056d94c.tar.bz2
Issue #17551667: Voice interaction service should be disabled...
...by default on Svelte devices Also make sure the voice_recognizers feature is not enabled on low-ram devices, with a new facility for platform feature declarations to say they should be ignored on low ram devices. Change-Id: I833c04b12e0e566dd682ed20adb0985c677a696f
Diffstat (limited to 'services/voiceinteraction/java')
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
index 82b7f8b..f5d4867 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
@@ -136,11 +136,14 @@ public class VoiceInteractionManagerService extends SystemService {
Settings.Secure.VOICE_INTERACTION_SERVICE, userHandle);
ComponentName curRecognizer = getCurRecognizer(userHandle);
VoiceInteractionServiceInfo curInteractorInfo = null;
- if (curInteractorStr == null && curRecognizer != null) {
+ if (curInteractorStr == null && curRecognizer != null
+ && !ActivityManager.isLowRamDeviceStatic()) {
// If there is no interactor setting, that means we are upgrading
// from an older platform version. If the current recognizer is not
// set or matches the preferred recognizer, then we want to upgrade
// the user to have the default voice interaction service enabled.
+ // Note that we don't do this for low-RAM devices, since we aren't
+ // supporting voice interaction services there.
curInteractorInfo = findAvailInteractor(userHandle, curRecognizer);
if (curInteractorInfo != null) {
// Looks good! We'll apply this one. To make it happen, we clear the
@@ -150,6 +153,15 @@ public class VoiceInteractionManagerService extends SystemService {
}
}
+ // If we are on a svelte device, make sure an interactor is not currently
+ // enabled; if it is, turn it off.
+ if (ActivityManager.isLowRamDeviceStatic() && curInteractorStr != null) {
+ if (!TextUtils.isEmpty(curInteractorStr)) {
+ setCurInteractor(null, userHandle);
+ curInteractorStr = "";
+ }
+ }
+
if (curRecognizer != null) {
// If we already have at least a recognizer, then we probably want to
// leave things as they are... unless something has disappeared.
@@ -171,10 +183,11 @@ public class VoiceInteractionManagerService extends SystemService {
}
}
- // Initializing settings, look for an interactor first.
- if (curInteractorInfo == null) {
+ // Initializing settings, look for an interactor first (but only on non-svelte).
+ if (curInteractorInfo == null && !ActivityManager.isLowRamDeviceStatic()) {
curInteractorInfo = findAvailInteractor(userHandle, null);
}
+
if (curInteractorInfo != null) {
// Eventually it will be an error to not specify this.
setCurInteractor(new ComponentName(curInteractorInfo.getServiceInfo().packageName,