1 /*
2  * Copyright (C) 2022 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 android.car.oem;
18 
19 import android.annotation.NonNull;
20 import android.annotation.SystemApi;
21 import android.media.AudioAttributes;
22 
23 import java.util.List;
24 
25 /*
26  * OemCarAudioDuckingService would expose all the method from IOemCarAudioDuckingService. It
27  * should always be in sync with IOemCarAudioDuckingService. OEM will implement
28  * OemCarAudioDuckingServiceInterface which would be used by OemCarAudioDuckingService.
29  */
30 
31 /**
32  * Interface for audio ducking for OEM Service.
33  *
34  * @hide
35  */
36 @SystemApi
37 public interface OemCarAudioDuckingService extends OemCarServiceComponent {
38 
39     /**
40      * Call to evaluate a ducking change.
41      *
42      * <p>The results will be evaluated against the currently ducked audio attributes. Any audio
43      * attribute that is currently ducked and not on the returned list will be un-ducked.
44      *
45      * @param requestInfo the current state of the audio service.
46      *
47      * @return the selected audio attribute which should be ducked.
48      *
49      */
50     @NonNull
evaluateAttributesToDuck(@onNull OemCarAudioVolumeRequest requestInfo)51     List<AudioAttributes> evaluateAttributesToDuck(@NonNull OemCarAudioVolumeRequest requestInfo);
52 }
53