summaryrefslogtreecommitdiffstats
path: root/services/voiceinteraction
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-07-30 08:57:39 -0700
committerEric Laurent <elaurent@google.com>2014-08-04 16:35:27 -0700
commitd3b8223377b8046280e4c09e728edc600171f941 (patch)
tree88d3e6bb021548e90b415791c3dbddc8870be60c /services/voiceinteraction
parent2265c8f70088b88b34ee9e315f7ae5519de1cdba (diff)
downloadframeworks_base-d3b8223377b8046280e4c09e728edc600171f941.zip
frameworks_base-d3b8223377b8046280e4c09e728edc600171f941.tar.gz
frameworks_base-d3b8223377b8046280e4c09e728edc600171f941.tar.bz2
SoundTrigger API update.
Add sound model update callback. Add native service state change callback. Add vendor UUID in sound model description. Add coarse confidence level in recognition event. Add capture format in recognition event. Bug: 12378680. Change-Id: Id63437819ec7b9a4a69e1ff6185b747e20cad95e
Diffstat (limited to 'services/voiceinteraction')
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java3
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java18
2 files changed, 20 insertions, 1 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java
index 8913eb9..b4c221f 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java
@@ -195,7 +195,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
Keyphrase[] keyphrases = new Keyphrase[1];
keyphrases[0] = new Keyphrase(
keyphraseId, recognitionModes, locale, text, users);
- return new KeyphraseSoundModel(UUID.fromString(modelUuid), data, keyphrases);
+ return new KeyphraseSoundModel(UUID.fromString(modelUuid),
+ null /* FIXME use vendor UUID */, data, keyphrases);
}
Slog.w(TAG, "No SoundModel available for the given keyphrase");
} finally {
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java
index f3ede88..fd36bfc 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java
@@ -25,6 +25,7 @@ import android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel;
import android.hardware.soundtrigger.SoundTrigger.ModuleProperties;
import android.hardware.soundtrigger.SoundTrigger.RecognitionConfig;
import android.hardware.soundtrigger.SoundTrigger.RecognitionEvent;
+import android.hardware.soundtrigger.SoundTrigger.SoundModelEvent;
import android.hardware.soundtrigger.SoundTriggerModule;
import android.os.RemoteException;
import android.util.Slog;
@@ -330,6 +331,23 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener {
}
}
+ public void onSoundModelUpdate(SoundModelEvent event) {
+ if (event == null) {
+ Slog.w(TAG, "Invalid sound model event!");
+ return;
+ }
+
+ if (DBG) Slog.d(TAG, "onSoundModelUpdate: " + event);
+
+ //TODO: implement sound model update
+ }
+
+ public void onServiceStateChange(int state) {
+ if (DBG) Slog.d(TAG, "onServiceStateChange, state: " + state);
+
+ //TODO: implement service state update
+ }
+
@Override
public void onServiceDied() {
synchronized (this) {