From 75c4443f4e561855d3bec7487e154b19a8ba69dc Mon Sep 17 00:00:00 2001 From: Charles Chen Date: Mon, 10 Apr 2023 19:34:25 +0000 Subject: [PATCH] Enable process restart behavior for VisualQueryDetectionService Since VisualQueryDetectionService shares process with HotwordDetectionService and when the latter restarted the former should also be restarted and calls the correct onRestart method. Add this capability. Bug: 265535257 Test: atest CtsVoiceInteractionTestCases Change-Id: Ie050d5f50b01d1f9e29e4fe4c8a48ed9bf116861 --- .../voiceinteraction/VisualQueryDetectorSession.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VisualQueryDetectorSession.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VisualQueryDetectorSession.java index aadb38da54697..2e05e2073e80e 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VisualQueryDetectorSession.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VisualQueryDetectorSession.java @@ -81,7 +81,12 @@ final class VisualQueryDetectorSession extends DetectorSession { void informRestartProcessLocked() { Slog.v(TAG, "informRestartProcessLocked"); mUpdateStateAfterStartFinished.set(false); - //TODO(b/261783819): Starts detection in VisualQueryDetectionService. + try { + mCallback.onProcessRestarted(); + } catch (RemoteException e) { + Slog.w(TAG, "Failed to communicate #onProcessRestarted", e); + notifyOnDetectorRemoteException(); + } } void setVisualQueryDetectionAttentionListenerLocked(