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