summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorAhaan Ugale <augale@google.com>2021-07-02 03:14:49 -0700
committerAhaan Ugale <augale@google.com>2021-07-02 19:06:06 -0700
commitcb8ebd1151cb280e68b00dbcff88fc9be0b563d0 (patch)
treefc7bc51c22fa0dab8f7c42dc46b9527e51bc4542 /core/java
parent53459e966bcf2c2bcc438c4181cdf42e0809acce (diff)
Init HotwordDetectionSrvc identity earlier
Grants mic access to the process as soon as it comes up, instead of waiting for the initialization status callback. Bug: 190011174 Test: manual - dsp and non-dsp; restarting while invoking the hotword Test: atest CtsVoiceInteractionTestCases Change-Id: I54e0b42868f663ae1c9edd9bcf4aaee2a13b827a
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/service/voice/HotwordDetectionService.java5
-rw-r--r--core/java/android/service/voice/IHotwordDetectionService.aidl6
2 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/service/voice/HotwordDetectionService.java b/core/java/android/service/voice/HotwordDetectionService.java
index 567ee2f65565..a43523974480 100644
--- a/core/java/android/service/voice/HotwordDetectionService.java
+++ b/core/java/android/service/voice/HotwordDetectionService.java
@@ -201,6 +201,11 @@ public abstract class HotwordDetectionService extends Service {
}
@Override
+ public void ping(IRemoteCallback callback) throws RemoteException {
+ callback.sendResult(null);
+ }
+
+ @Override
public void stopDetection() {
HotwordDetectionService.this.onStopDetection();
}
diff --git a/core/java/android/service/voice/IHotwordDetectionService.aidl b/core/java/android/service/voice/IHotwordDetectionService.aidl
index d7ed67812e87..f2a93f100986 100644
--- a/core/java/android/service/voice/IHotwordDetectionService.aidl
+++ b/core/java/android/service/voice/IHotwordDetectionService.aidl
@@ -57,5 +57,11 @@ oneway interface IHotwordDetectionService {
in IContentCaptureManager contentCaptureManager,
in ContentCaptureOptions options);
+ /**
+ * Simply requests the service to trigger the callback, so that the system can check its
+ * identity.
+ */
+ void ping(in IRemoteCallback callback);
+
void stopDetection();
}