Loading core/java/android/hardware/soundtrigger/SoundTrigger.java +4 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.content.Context; import android.media.AudioFormat; import android.media.permission.Identity; import android.media.soundtrigger.Status; import android.media.soundtrigger_middleware.ISoundTriggerInjection; import android.media.soundtrigger_middleware.ISoundTriggerMiddlewareService; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; import android.os.Build; Loading Loading @@ -77,9 +78,11 @@ public class SoundTrigger { } /** * Model architecture associated with a fake STHAL which can be injected. * Used for testing purposes. * @hide */ public static final String FAKE_HAL_ARCH = "injection"; public static final String FAKE_HAL_ARCH = ISoundTriggerInjection.FAKE_HAL_ARCH; /** * Status code used when the operation succeeded Loading media/Android.bp +1 −4 Original line number Diff line number Diff line Loading @@ -29,10 +29,7 @@ aidl_interface { }, }, srcs: [ "aidl/android/media/soundtrigger_middleware/ISoundTriggerCallback.aidl", "aidl/android/media/soundtrigger_middleware/ISoundTriggerMiddlewareService.aidl", "aidl/android/media/soundtrigger_middleware/ISoundTriggerModule.aidl", "aidl/android/media/soundtrigger_middleware/SoundTriggerModuleDescriptor.aidl", "aidl/android/media/soundtrigger_middleware/*.aidl", ], imports: [ "android.media.audio.common.types-V2", Loading media/aidl/android/media/soundtrigger_middleware/IAcknowledgeEvent.aidl 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media.soundtrigger_middleware; /** * Opaque callback for acknowledging oneway events. * Since there is no return channel for oneway events, * passing this interface in a oneway method allows the service to call * back to the client to indicate the event was registered. * This essentially functions like a <code> Future<void> </code> without * an error channel. * {@hide} */ oneway interface IAcknowledgeEvent { /** * Acknowledge that the event has been received. */ void eventReceived(); } media/aidl/android/media/soundtrigger_middleware/IInjectGlobalEvent.aidl 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media.soundtrigger_middleware; import android.media.soundtrigger_middleware.IAcknowledgeEvent; /** * Interface for injecting global events to the fake STHAL. * {@hide} */ oneway interface IInjectGlobalEvent { /** * Request a fake STHAL restart. * This invalidates the {@link IInjectGlobalEvent}. */ void triggerRestart(); /** * Triggers global resource contention into the fake STHAL. Loads/startRecognition * will fail with RESOURCE_CONTENTION. * @param isContended - true to enable resource contention. false to disable resource contention * and resume normal functionality. * @param callback - Call {@link IAcknowledgeEvent#eventReceived()} on this interface once * the contention status is successfully set. */ void setResourceContention(boolean isContended, IAcknowledgeEvent callback); } media/aidl/android/media/soundtrigger_middleware/IInjectModelEvent.aidl 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media.soundtrigger_middleware; /** * Interface for injecting model events into the fake ST HAL. * * {@hide} */ oneway interface IInjectModelEvent { /** * Trigger a preemptive model unload for the model session associated with * this object. * This invalidates the {@link IInjectModelEvent} session. */ void triggerUnloadModel(); } Loading
core/java/android/hardware/soundtrigger/SoundTrigger.java +4 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.content.Context; import android.media.AudioFormat; import android.media.permission.Identity; import android.media.soundtrigger.Status; import android.media.soundtrigger_middleware.ISoundTriggerInjection; import android.media.soundtrigger_middleware.ISoundTriggerMiddlewareService; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; import android.os.Build; Loading Loading @@ -77,9 +78,11 @@ public class SoundTrigger { } /** * Model architecture associated with a fake STHAL which can be injected. * Used for testing purposes. * @hide */ public static final String FAKE_HAL_ARCH = "injection"; public static final String FAKE_HAL_ARCH = ISoundTriggerInjection.FAKE_HAL_ARCH; /** * Status code used when the operation succeeded Loading
media/Android.bp +1 −4 Original line number Diff line number Diff line Loading @@ -29,10 +29,7 @@ aidl_interface { }, }, srcs: [ "aidl/android/media/soundtrigger_middleware/ISoundTriggerCallback.aidl", "aidl/android/media/soundtrigger_middleware/ISoundTriggerMiddlewareService.aidl", "aidl/android/media/soundtrigger_middleware/ISoundTriggerModule.aidl", "aidl/android/media/soundtrigger_middleware/SoundTriggerModuleDescriptor.aidl", "aidl/android/media/soundtrigger_middleware/*.aidl", ], imports: [ "android.media.audio.common.types-V2", Loading
media/aidl/android/media/soundtrigger_middleware/IAcknowledgeEvent.aidl 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media.soundtrigger_middleware; /** * Opaque callback for acknowledging oneway events. * Since there is no return channel for oneway events, * passing this interface in a oneway method allows the service to call * back to the client to indicate the event was registered. * This essentially functions like a <code> Future<void> </code> without * an error channel. * {@hide} */ oneway interface IAcknowledgeEvent { /** * Acknowledge that the event has been received. */ void eventReceived(); }
media/aidl/android/media/soundtrigger_middleware/IInjectGlobalEvent.aidl 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media.soundtrigger_middleware; import android.media.soundtrigger_middleware.IAcknowledgeEvent; /** * Interface for injecting global events to the fake STHAL. * {@hide} */ oneway interface IInjectGlobalEvent { /** * Request a fake STHAL restart. * This invalidates the {@link IInjectGlobalEvent}. */ void triggerRestart(); /** * Triggers global resource contention into the fake STHAL. Loads/startRecognition * will fail with RESOURCE_CONTENTION. * @param isContended - true to enable resource contention. false to disable resource contention * and resume normal functionality. * @param callback - Call {@link IAcknowledgeEvent#eventReceived()} on this interface once * the contention status is successfully set. */ void setResourceContention(boolean isContended, IAcknowledgeEvent callback); }
media/aidl/android/media/soundtrigger_middleware/IInjectModelEvent.aidl 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media.soundtrigger_middleware; /** * Interface for injecting model events into the fake ST HAL. * * {@hide} */ oneway interface IInjectModelEvent { /** * Trigger a preemptive model unload for the model session associated with * this object. * This invalidates the {@link IInjectModelEvent} session. */ void triggerUnloadModel(); }