Log metric when client HotwordDetectionService crashes

Bug: 244387931
Test: use CTS hotword service to crash itself and check
statsd_testdrive.

Change-Id: Ia6a3027eb2dc6f45d77c3025f30c43f1d93a3a2c
This commit is contained in:
Joanne
2022-12-22 17:05:50 +08:00
parent 7c0634d9c9
commit daace8183d

View File

@@ -25,6 +25,7 @@ import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_EVENT
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__DETECTOR_TYPE__NORMAL_DETECTOR;
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__DETECTOR_TYPE__TRUSTED_DETECTOR_DSP;
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__KEYPHRASE_TRIGGER;
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__SERVICE_CRASH;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -541,6 +542,11 @@ final class HotwordDetectionConnection {
HotwordDetectorSession.HOTWORD_DETECTION_SERVICE_DIED);
});
}
// Can improve to log exit reason if needed
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
mDetectorType,
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__SERVICE_CRASH,
mVoiceInteractionServiceUid);
}
@Override