1 /* 2 * Copyright (C) 2015 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.media; 18 19 import android.car.media.CarAudioPatchHandle; 20 import android.car.media.CarVolumeGroupInfo; 21 import android.media.AudioAttributes; 22 import android.media.AudioDeviceAttributes; 23 /** 24 * Binder interface for {@link android.car.media.CarAudioManager}. 25 * Check {@link android.car.media.CarAudioManager} APIs for expected behavior of each call. 26 * 27 * @hide 28 */ 29 interface ICarAudio { isAudioFeatureEnabled(int feature)30 boolean isAudioFeatureEnabled(int feature); 31 setGroupVolume(int zoneId, int groupId, int index, int flags)32 void setGroupVolume(int zoneId, int groupId, int index, int flags); getGroupMaxVolume(int zoneId, int groupId)33 int getGroupMaxVolume(int zoneId, int groupId); getGroupMinVolume(int zoneId, int groupId)34 int getGroupMinVolume(int zoneId, int groupId); getGroupVolume(int zoneId, int groupId)35 int getGroupVolume(int zoneId, int groupId); 36 setFadeTowardFront(float value)37 void setFadeTowardFront(float value); setBalanceTowardRight(float value)38 void setBalanceTowardRight(float value); 39 getExternalSources()40 String[] getExternalSources(); createAudioPatch(in String sourceAddress, int usage, int gainInMillibels)41 CarAudioPatchHandle createAudioPatch(in String sourceAddress, int usage, int gainInMillibels); releaseAudioPatch(in CarAudioPatchHandle patch)42 void releaseAudioPatch(in CarAudioPatchHandle patch); 43 getVolumeGroupCount(int zoneId)44 int getVolumeGroupCount(int zoneId); getVolumeGroupIdForUsage(int zoneId, int usage)45 int getVolumeGroupIdForUsage(int zoneId, int usage); getUsagesForVolumeGroupId(int zoneId, int groupId)46 int[] getUsagesForVolumeGroupId(int zoneId, int groupId); 47 getAudioZoneIds()48 int[] getAudioZoneIds(); getZoneIdForUid(int uid)49 int getZoneIdForUid(int uid); setZoneIdForUid(int zoneId, int uid)50 boolean setZoneIdForUid(int zoneId, int uid); clearZoneIdForUid(int uid)51 boolean clearZoneIdForUid(int uid); 52 isVolumeGroupMuted(int zoneId, int groupId)53 boolean isVolumeGroupMuted(int zoneId, int groupId); setVolumeGroupMute(int zoneId, int groupId, boolean mute, int flags)54 void setVolumeGroupMute(int zoneId, int groupId, boolean mute, int flags); getVolumeGroupInfo(int zoneId, int groupId)55 CarVolumeGroupInfo getVolumeGroupInfo(int zoneId, int groupId); getVolumeGroupInfosForZone(int zoneId)56 List<CarVolumeGroupInfo> getVolumeGroupInfosForZone(int zoneId); 57 getAudioAttributesForVolumeGroup(in CarVolumeGroupInfo groupInfo)58 List<AudioAttributes> getAudioAttributesForVolumeGroup(in CarVolumeGroupInfo groupInfo); 59 getOutputDeviceAddressForUsage(int zoneId, int usage)60 String getOutputDeviceAddressForUsage(int zoneId, int usage); 61 getInputDevicesForZoneId(int zoneId)62 List<AudioDeviceAttributes> getInputDevicesForZoneId(int zoneId); 63 isPlaybackOnVolumeGroupActive(int volumeGroupId, int audioZoneId)64 boolean isPlaybackOnVolumeGroupActive(int volumeGroupId, int audioZoneId); 65 /** 66 * IBinder is ICarVolumeCallback but passed as IBinder due to aidl hidden. 67 */ registerVolumeCallback(in IBinder binder)68 void registerVolumeCallback(in IBinder binder); unregisterVolumeCallback(in IBinder binder)69 void unregisterVolumeCallback(in IBinder binder); 70 } 71