summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Peter Li <lpeter@google.com> 2023-02-23 02:33:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-02-23 02:33:55 +0000
commitc76fab19da3267bf508cfe2978e1bf96151b0e0e (patch)
tree78665db33b00985f4437999a5958673b5993edc4
parent36c5abbb5c9198c4fa25f427f9a29452d31e96cf (diff)
parent996d706cf8a44fcacd111a4002b5372ac3793545 (diff)
Merge "Add the logs when it fails in onDetected method." into udc-dev
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/DetectorSession.java4
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/DspTrustedHotwordDetectorSession.java3
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/SoftwareTrustedHotwordDetectorSession.java2
3 files changed, 8 insertions, 1 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/DetectorSession.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/DetectorSession.java
index ec9bd2fbfa6d..021823e5fc78 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/DetectorSession.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/DetectorSession.java
@@ -510,6 +510,8 @@ abstract class DetectorSession {
try {
enforcePermissionsForDataDelivery();
} catch (SecurityException e) {
+ Slog.w(TAG, "Ignoring #onDetected due to a "
+ + "SecurityException", e);
HotwordMetricsLogger.writeDetectorEvent(
getDetectorType(),
EXTERNAL_SOURCE_DETECT_SECURITY_EXCEPTION,
@@ -525,6 +527,8 @@ abstract class DetectorSession {
newResult = mHotwordAudioStreamCopier
.startCopyingAudioStreams(triggerResult);
} catch (IOException e) {
+ Slog.w(TAG, "Ignoring #onDetected due to a "
+ + "IOException", e);
// TODO: Write event
callback.onError(new HotwordDetectionServiceFailure(
CALLBACK_ONDETECTED_STREAM_COPY_ERROR,
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/DspTrustedHotwordDetectorSession.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/DspTrustedHotwordDetectorSession.java
index 63e0f466bb10..e6cb943cbb67 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/DspTrustedHotwordDetectorSession.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/DspTrustedHotwordDetectorSession.java
@@ -126,7 +126,7 @@ final class DspTrustedHotwordDetectorSession extends DetectorSession {
enforcePermissionsForDataDelivery();
enforceExtraKeyphraseIdNotLeaked(result, recognitionEvent);
} catch (SecurityException e) {
- Slog.i(TAG, "Ignoring #onDetected due to a SecurityException", e);
+ Slog.w(TAG, "Ignoring #onDetected due to a SecurityException", e);
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
HotwordDetector.DETECTOR_TYPE_TRUSTED_HOTWORD_DSP,
METRICS_KEYPHRASE_TRIGGERED_DETECT_SECURITY_EXCEPTION,
@@ -141,6 +141,7 @@ final class DspTrustedHotwordDetectorSession extends DetectorSession {
try {
newResult = mHotwordAudioStreamCopier.startCopyingAudioStreams(result);
} catch (IOException e) {
+ Slog.w(TAG, "Ignoring #onDetected due to a IOException", e);
externalCallback.onDetectionFailure(new HotwordDetectionServiceFailure(
CALLBACK_ONDETECTED_STREAM_COPY_ERROR,
"Copy audio stream failure."));
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/SoftwareTrustedHotwordDetectorSession.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/SoftwareTrustedHotwordDetectorSession.java
index 522d832c41bc..3f053b0fe95f 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/SoftwareTrustedHotwordDetectorSession.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/SoftwareTrustedHotwordDetectorSession.java
@@ -118,6 +118,7 @@ final class SoftwareTrustedHotwordDetectorSession extends DetectorSession {
try {
enforcePermissionsForDataDelivery();
} catch (SecurityException e) {
+ Slog.w(TAG, "Ignoring #onDetected due to a SecurityException", e);
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
HotwordDetector.DETECTOR_TYPE_TRUSTED_HOTWORD_SOFTWARE,
METRICS_KEYPHRASE_TRIGGERED_DETECT_SECURITY_EXCEPTION,
@@ -132,6 +133,7 @@ final class SoftwareTrustedHotwordDetectorSession extends DetectorSession {
try {
newResult = mHotwordAudioStreamCopier.startCopyingAudioStreams(result);
} catch (IOException e) {
+ Slog.w(TAG, "Ignoring #onDetected due to a IOException", e);
// TODO: Write event
mSoftwareCallback.onError(new HotwordDetectionServiceFailure(
CALLBACK_ONDETECTED_STREAM_COPY_ERROR,