1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.server.soundtrigger_middleware;
18 
19 import android.media.soundtrigger_middleware.ISoundTriggerCallback;
20 import android.media.soundtrigger_middleware.ISoundTriggerModule;
21 import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor;
22 
23 /**
24  * This interface closely follows ISoundTriggerMiddlewareService with some subtle changes for
25  * convenience.
26  *
27  * The ISoundTriggerMiddlewareService have been modified to exclude identity information and the
28  * RemoteException signature, both of which are only relevant at the service boundary layer.
29  */
30 public interface ISoundTriggerMiddlewareInternal {
31     /**
32      * Query the available modules and their capabilities.
33      */
listModules()34     public SoundTriggerModuleDescriptor[] listModules();
35 
36     /**
37      * Attach to one of the available modules.
38      *
39      * listModules() must be called prior to calling this method and the provided handle must be
40      * one of the handles from the returned list.
41      * @param isTrusted - {@code true} if this service should not note AppOps for recognitions,
42      * and should delegate these checks to the **trusted** client.
43      */
attach(int handle, ISoundTriggerCallback callback, boolean isTrusted)44     public ISoundTriggerModule attach(int handle,
45             ISoundTriggerCallback callback,
46             boolean isTrusted);
47 }
48