summaryrefslogtreecommitdiffstats
path: root/core/java/android/hardware/soundtrigger
diff options
context:
space:
mode:
authorSandeep Siddhartha <sansid@google.com>2014-07-20 12:22:56 -0700
committerSandeep Siddhartha <sansid@google.com>2014-07-20 16:53:09 -0700
commit110f569b47bc21fb38ec25b6110ee302ce137e06 (patch)
treeb596841dbf21aaf5d23e1d905cf2914f5f6d53e4 /core/java/android/hardware/soundtrigger
parent8ca1fdc10b9afb831636ce00e48b9692476413c5 (diff)
downloadframeworks_base-110f569b47bc21fb38ec25b6110ee302ce137e06.zip
frameworks_base-110f569b47bc21fb38ec25b6110ee302ce137e06.tar.gz
frameworks_base-110f569b47bc21fb38ec25b6110ee302ce137e06.tar.bz2
Fix synchronization issues in AlwaysOnHotwordDetector
- Remove unnecessary recognition status from AlwaysOnHotwordDetector - Remove unnecessary recognition started callback from IRecognitionStatusCallback - Fix a bug around the fact that we weren't picking up enrollment at runtime because we were storing the availability at instantiation time. - Handle 0-length arrays in SoundTrigger classes while parceling/unparceling - Fix issue in SoundTrigger helper where we were not comparing binders for start/stop calls - Unload the previous model when starting a new recognition - Add more debug logging Change-Id: Icc56d7f3dd1ffa49a8cfeea49080e3ab4d342c32
Diffstat (limited to 'core/java/android/hardware/soundtrigger')
-rw-r--r--core/java/android/hardware/soundtrigger/IRecognitionStatusCallback.aidl4
-rw-r--r--core/java/android/hardware/soundtrigger/SoundTrigger.java24
2 files changed, 18 insertions, 10 deletions
diff --git a/core/java/android/hardware/soundtrigger/IRecognitionStatusCallback.aidl b/core/java/android/hardware/soundtrigger/IRecognitionStatusCallback.aidl
index 5738909..038d7ef 100644
--- a/core/java/android/hardware/soundtrigger/IRecognitionStatusCallback.aidl
+++ b/core/java/android/hardware/soundtrigger/IRecognitionStatusCallback.aidl
@@ -29,10 +29,6 @@ oneway interface IRecognitionStatusCallback {
*/
void onDetected(in byte[] data);
/**
- * Called when the detection for the associated keyphrase starts.
- */
- void onDetectionStarted();
- /**
* Called when the detection for the associated keyphrase stops.
*/
void onDetectionStopped();
diff --git a/core/java/android/hardware/soundtrigger/SoundTrigger.java b/core/java/android/hardware/soundtrigger/SoundTrigger.java
index 7b0a678..9a5cd9b 100644
--- a/core/java/android/hardware/soundtrigger/SoundTrigger.java
+++ b/core/java/android/hardware/soundtrigger/SoundTrigger.java
@@ -247,7 +247,7 @@ public class SoundTrigger {
String text = in.readString();
int[] users = null;
int numUsers = in.readInt();
- if (numUsers > 0) {
+ if (numUsers >= 0) {
users = new int[numUsers];
in.readIntArray(users);
}
@@ -264,7 +264,7 @@ public class SoundTrigger {
dest.writeInt(users.length);
dest.writeIntArray(users);
} else {
- dest.writeInt(0);
+ dest.writeInt(-1);
}
}
@@ -349,7 +349,7 @@ public class SoundTrigger {
UUID uuid = UUID.fromString(in.readString());
byte[] data = null;
int dataLength = in.readInt();
- if (dataLength > 0) {
+ if (dataLength >= 0) {
data = new byte[dataLength];
in.readByteArray(data);
}
@@ -369,10 +369,16 @@ public class SoundTrigger {
dest.writeInt(data.length);
dest.writeByteArray(data);
} else {
- dest.writeInt(0);
+ dest.writeInt(-1);
}
dest.writeTypedArray(keyphrases, 0);
}
+
+ @Override
+ public String toString() {
+ return "KeyphraseSoundModel [keyphrases=" + Arrays.toString(keyphrases) + ", uuid="
+ + uuid + ", type=" + type + ", data? " + (data != null) + "]";
+ }
}
/**
@@ -471,7 +477,7 @@ public class SoundTrigger {
in.createTypedArray(KeyphraseRecognitionExtra.CREATOR);
byte[] data = null;
int dataLength = in.readInt();
- if (dataLength > 0) {
+ if (dataLength >= 0) {
data = new byte[dataLength];
in.readByteArray(data);
}
@@ -486,7 +492,7 @@ public class SoundTrigger {
dest.writeInt(data.length);
dest.writeByteArray(data);
} else {
- dest.writeInt(0);
+ dest.writeInt(-1);
}
}
@@ -494,6 +500,12 @@ public class SoundTrigger {
public int describeContents() {
return 0;
}
+
+ @Override
+ public String toString() {
+ return "RecognitionConfig [captureRequested=" + captureRequested + ", keyphrases="
+ + Arrays.toString(keyphrases) + ", data? " + (data != null) + "]";
+ }
}
/**