summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/service/voice/AlwaysOnHotwordDetector.java24
-rw-r--r--core/java/android/service/voice/HotwordDetectionService.java16
-rw-r--r--core/java/android/service/voice/IHotwordDetectionService.aidl2
3 files changed, 20 insertions, 22 deletions
diff --git a/core/java/android/service/voice/AlwaysOnHotwordDetector.java b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
index 1ea40bea8e57..7efcc81ccc2e 100644
--- a/core/java/android/service/voice/AlwaysOnHotwordDetector.java
+++ b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
@@ -508,7 +508,7 @@ public class AlwaysOnHotwordDetector {
mTargetSdkVersion = targetSdkVersion;
mSupportHotwordDetectionService = supportHotwordDetectionService;
if (mSupportHotwordDetectionService) {
- setHotwordDetectionServiceConfig(options, sharedMemory);
+ updateState(options, sharedMemory);
}
try {
Identity identity = new Identity();
@@ -524,30 +524,28 @@ public class AlwaysOnHotwordDetector {
/**
* Set configuration and pass read-only data to hotword detection service.
*
- * @param options Application configuration data provided by the
- * {@link VoiceInteractionService}. PersistableBundle does not allow any remotable objects or
+ * @param options Application configuration data to provide to the
+ * {@link HotwordDetectionService}. PersistableBundle does not allow any remotable objects or
* other contents that can be used to communicate with other processes.
- * @param sharedMemory The unrestricted data blob provided by the
- * {@link VoiceInteractionService}. Use this to provide the hotword models data or other
+ * @param sharedMemory The unrestricted data blob to provide to the
+ * {@link HotwordDetectionService}. Use this to provide the hotword models data or other
* such data to the trusted process.
*
- * @throws IllegalStateException if it doesn't support hotword detection service.
- *
- * @hide
+ * @throws IllegalStateException if this AlwaysOnHotwordDetector wasn't specified to use a
+ * {@link HotwordDetectionService} when it was created.
*/
- public final void setHotwordDetectionServiceConfig(@Nullable PersistableBundle options,
+ public final void updateState(@Nullable PersistableBundle options,
@Nullable SharedMemory sharedMemory) {
if (DBG) {
- Slog.d(TAG, "setHotwordDetectionServiceConfig()");
+ Slog.d(TAG, "updateState()");
}
if (!mSupportHotwordDetectionService) {
throw new IllegalStateException(
- "setHotwordDetectionServiceConfig called, but it doesn't support hotword"
- + " detection service");
+ "updateState called, but it doesn't support hotword detection service");
}
try {
- mModelManagementService.setHotwordDetectionServiceConfig(options, sharedMemory);
+ mModelManagementService.updateState(options, sharedMemory);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/service/voice/HotwordDetectionService.java b/core/java/android/service/voice/HotwordDetectionService.java
index 686268c3d854..db984c246b2f 100644
--- a/core/java/android/service/voice/HotwordDetectionService.java
+++ b/core/java/android/service/voice/HotwordDetectionService.java
@@ -82,10 +82,10 @@ public abstract class HotwordDetectionService extends Service {
}
@Override
- public void setConfig(PersistableBundle options, SharedMemory sharedMemory)
+ public void updateState(PersistableBundle options, SharedMemory sharedMemory)
throws RemoteException {
if (DBG) {
- Log.d(TAG, "#setConfig");
+ Log.d(TAG, "#updateState");
}
mHandler.sendMessage(obtainMessage(HotwordDetectionService::onUpdateState,
HotwordDetectionService.this,
@@ -139,14 +139,14 @@ public abstract class HotwordDetectionService extends Service {
/**
* Called when the {@link VoiceInteractionService#createAlwaysOnHotwordDetector(String, Locale,
* PersistableBundle, SharedMemory, AlwaysOnHotwordDetector.Callback)} or
- * {@link AlwaysOnHotwordDetector#setHotwordDetectionServiceConfig(PersistableBundle,
- * SharedMemory)} requests an update of the hotword detection parameters.
+ * {@link AlwaysOnHotwordDetector#updateState(PersistableBundle, SharedMemory)} requests an
+ * update of the hotword detection parameters.
*
- * @param options Application configuration data provided by the
- * {@link VoiceInteractionService}. PersistableBundle does not allow any remotable objects or
+ * @param options Application configuration data to provide to the
+ * {@link HotwordDetectionService}. PersistableBundle does not allow any remotable objects or
* other contents that can be used to communicate with other processes.
- * @param sharedMemory The unrestricted data blob provided by the
- * {@link VoiceInteractionService}. Use this to provide the hotword models data or other
+ * @param sharedMemory The unrestricted data blob to provide to the
+ * {@link HotwordDetectionService}. Use this to provide the hotword models data or other
* such data to the trusted process.
*
* @hide
diff --git a/core/java/android/service/voice/IHotwordDetectionService.aidl b/core/java/android/service/voice/IHotwordDetectionService.aidl
index 8d01dd1bf340..0791f1ca49eb 100644
--- a/core/java/android/service/voice/IHotwordDetectionService.aidl
+++ b/core/java/android/service/voice/IHotwordDetectionService.aidl
@@ -34,5 +34,5 @@ oneway interface IHotwordDetectionService {
long timeoutMillis,
in IDspHotwordDetectionCallback callback);
- void setConfig(in PersistableBundle options, in SharedMemory sharedMemory);
+ void updateState(in PersistableBundle options, in SharedMemory sharedMemory);
}