AOHD do not unbind HotwordDetectionService on destroy
AlwaysOnHotwordDetector should not be required to tear down the
HotwordDetectionService.
The VoiceInteractionManagerService will handle the unbinding and
shutdown of the service on its own.
Bug: 277392480
Test: atest AlwaysOnHotwordDetectorTest
Change-Id: Iec0af794595f0e8d143d7bab118c4b1f02569c31
diff --git a/core/java/android/service/voice/VoiceInteractionService.java b/core/java/android/service/voice/VoiceInteractionService.java
index 79a4f54..6e85de2 100644
--- a/core/java/android/service/voice/VoiceInteractionService.java
+++ b/core/java/android/service/voice/VoiceInteractionService.java
@@ -1070,21 +1070,6 @@
mActiveVisualQueryDetector = null;
}
mActiveDetectors.remove(detector);
- shutdownHotwordDetectionServiceIfRequiredLocked();
- }
- }
-
- private void shutdownHotwordDetectionServiceIfRequiredLocked() {
- for (HotwordDetector detector : mActiveDetectors) {
- if (detector.isUsingSandboxedDetectionService()) {
- return;
- }
- }
-
- try {
- mSystemService.shutdownHotwordDetectionService();
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
}
}