Merge changes from topic "presubmit-am-12354d5aed1b43208d3598174f1f4717" into tm-mainline-prod
* changes:
[automerge] Add and update some hotword detection metrics 2p: ee5e2a7a3f
Add and update some hotword detection metrics
This commit is contained in:
committed by
Android (Google) Code Review
commit
05beaec741
@@ -39,10 +39,13 @@ 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__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__DETECTOR_TYPE__TRUSTED_DETECTOR_DSP;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECTED;
|
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECTED;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_EXCEPTION;
|
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_SECURITY_EXCEPTION;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_TIMEOUT;
|
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_TIMEOUT;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_UNEXPECTED_CALLBACK;
|
||||||
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__KEYPHRASE_TRIGGER;
|
||||||
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;
|
||||||
|
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.server.voiceinteraction.SoundTriggerSessionPermissionsDecorator.enforcePermissionForPreflight;
|
import static com.android.server.voiceinteraction.SoundTriggerSessionPermissionsDecorator.enforcePermissionForPreflight;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
@@ -133,6 +136,13 @@ final class HotwordDetectionConnection {
|
|||||||
private static final int METRICS_INIT_CALLBACK_STATE_SUCCESS =
|
private static final int METRICS_INIT_CALLBACK_STATE_SUCCESS =
|
||||||
HOTWORD_DETECTION_SERVICE_INIT_RESULT_REPORTED__RESULT__CALLBACK_INIT_STATE_SUCCESS;
|
HOTWORD_DETECTION_SERVICE_INIT_RESULT_REPORTED__RESULT__CALLBACK_INIT_STATE_SUCCESS;
|
||||||
|
|
||||||
|
private static final int METRICS_KEYPHRASE_TRIGGERED_DETECT_SECURITY_EXCEPTION =
|
||||||
|
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_SECURITY_EXCEPTION;
|
||||||
|
private static final int METRICS_KEYPHRASE_TRIGGERED_DETECT_UNEXPECTED_CALLBACK =
|
||||||
|
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_UNEXPECTED_CALLBACK;
|
||||||
|
private static final int METRICS_KEYPHRASE_TRIGGERED_REJECT_UNEXPECTED_CALLBACK =
|
||||||
|
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__REJECT_UNEXPECTED_CALLBACK;
|
||||||
|
|
||||||
private final Executor mAudioCopyExecutor = Executors.newCachedThreadPool();
|
private final Executor mAudioCopyExecutor = Executors.newCachedThreadPool();
|
||||||
// TODO: This may need to be a Handler(looper)
|
// TODO: This may need to be a Handler(looper)
|
||||||
private final ScheduledExecutorService mScheduledExecutorService =
|
private final ScheduledExecutorService mScheduledExecutorService =
|
||||||
@@ -575,7 +585,7 @@ final class HotwordDetectionConnection {
|
|||||||
Slog.i(TAG, "Ignoring #onDetected due to a process restart");
|
Slog.i(TAG, "Ignoring #onDetected due to a process restart");
|
||||||
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
|
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
|
||||||
mDetectorType,
|
mDetectorType,
|
||||||
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_EXCEPTION);
|
METRICS_KEYPHRASE_TRIGGERED_DETECT_UNEXPECTED_CALLBACK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mValidatingDspTrigger = false;
|
mValidatingDspTrigger = false;
|
||||||
@@ -584,7 +594,7 @@ final class HotwordDetectionConnection {
|
|||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
|
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
|
||||||
mDetectorType,
|
mDetectorType,
|
||||||
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_EXCEPTION);
|
METRICS_KEYPHRASE_TRIGGERED_DETECT_SECURITY_EXCEPTION);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
externalCallback.onKeyphraseDetected(recognitionEvent, result);
|
externalCallback.onKeyphraseDetected(recognitionEvent, result);
|
||||||
@@ -614,7 +624,7 @@ final class HotwordDetectionConnection {
|
|||||||
Slog.i(TAG, "Ignoring #onRejected due to a process restart");
|
Slog.i(TAG, "Ignoring #onRejected due to a process restart");
|
||||||
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
|
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
|
||||||
mDetectorType,
|
mDetectorType,
|
||||||
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__DETECT_EXCEPTION);
|
METRICS_KEYPHRASE_TRIGGERED_REJECT_UNEXPECTED_CALLBACK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mValidatingDspTrigger = false;
|
mValidatingDspTrigger = false;
|
||||||
@@ -687,6 +697,9 @@ final class HotwordDetectionConnection {
|
|||||||
// rejection. This also allows the Interactor to startReco again
|
// rejection. This also allows the Interactor to startReco again
|
||||||
try {
|
try {
|
||||||
mCallback.onRejected(new HotwordRejectedResult.Builder().build());
|
mCallback.onRejected(new HotwordRejectedResult.Builder().build());
|
||||||
|
HotwordMetricsLogger.writeKeyphraseTriggerEvent(
|
||||||
|
mDetectorType,
|
||||||
|
HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED__RESULT__REJECTED_FROM_RESTART);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.w(TAG, "Failed to call #rejected");
|
Slog.w(TAG, "Failed to call #rejected");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user