Log metric when client HotwordDetectionService crashes

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

Change-Id: Icbd10c73df268bc7ff38c986551e30e61aa95177
Merged-in: Ia6a3027eb2dc6f45d77c3025f30c43f1d93a3a2c
This commit is contained in:
Joanne Chung
2022-12-27 15:11:13 +00:00
parent eeaee6e734
commit bc9ad765ec

View File

@@ -55,6 +55,7 @@ import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPH
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__REJECTED;
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__REJECTED_FROM_RESTART;
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__REJECT_UNEXPECTED_CALLBACK;
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__SERVICE_CRASH;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -1152,6 +1153,11 @@ final class HotwordDetectionConnection {
Slog.w(TAG, "Failed to report onError status: " + e);
}
}
// Can improve to log exit reason if needed
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
mDetectorType,
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__SERVICE_CRASH,
mVoiceInteractionServiceUid);
}
@Override