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.AudioManager; 22 23 /* 24 * OemCarAudioVolumeService would expose all the method from IOemCarAudioVolumeService. It 25 * should always be in sync with IOemCarAudioVolumeService. Oem will implement 26 * OemCarAudioVolumeServiceInterface which would be used by OemCarAudioVolumeService. 27 */ 28 29 /** 30 * Interface for audio volume for OEM Service. 31 * 32 * @hide 33 */ 34 @SystemApi 35 public interface OemCarAudioVolumeService extends OemCarServiceComponent { 36 37 /** 38 * Call to evaluate a volume change. 39 * 40 * <p>The adjustment request is one of {@link AudioManager#ADJUST_RAISE}, 41 * {@link AudioManager#ADJUST_LOWER}, {@link AudioManager#ADJUST_SAME}, 42 * {@link AudioManager#ADJUST_MUTE}, {@link AudioManager#ADJUST_UNMUTE}, 43 * {@link AudioManager#ADJUST_TOGGLE_MUTE}. The request info contains information to make a 44 * decision about which volume should be selected for change. 45 * 46 * <p>The corresponding change will be determined by comparing the corresponding state 47 * of the volume group info and the value returned here. For example, for a request to evaluate 48 * {@code AudioManager#ADJUST_UNMUTE} the volume group info's mute state should be unmuted. 49 * 50 * @param requestInfo the current state of the audio service. 51 * @param volumeAdjustment the current volume adjustment to evaluate. 52 * 53 * @return the selected volume group which should change. 54 */ 55 @NonNull getSuggestedGroupForVolumeChange( @onNull OemCarAudioVolumeRequest requestInfo, int volumeAdjustment)56 OemCarVolumeChangeInfo getSuggestedGroupForVolumeChange( 57 @NonNull OemCarAudioVolumeRequest requestInfo, int volumeAdjustment); 58 } 59