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 com.android.server.hdmi; 18 19 import static android.media.AudioDeviceVolumeManager.OnAudioDeviceVolumeChangedListener; 20 import static android.media.AudioDeviceVolumeManager.OnDeviceVolumeBehaviorChangedListener; 21 22 import android.annotation.CallbackExecutor; 23 import android.annotation.NonNull; 24 import android.media.AudioDeviceAttributes; 25 import android.media.AudioDeviceVolumeManager; 26 import android.media.VolumeInfo; 27 28 import java.util.concurrent.Executor; 29 30 /** 31 * Interface with the methods from {@link AudioDeviceVolumeManager} used by the HDMI framework. 32 * Allows the class to be faked for tests. 33 */ 34 public interface AudioDeviceVolumeManagerWrapperInterface { 35 36 /** 37 * Wrapper for {@link AudioDeviceVolumeManager#addOnDeviceVolumeBehaviorChangedListener( 38 * Executor, OnDeviceVolumeBehaviorChangedListener)} 39 */ addOnDeviceVolumeBehaviorChangedListener( @onNull @allbackExecutor Executor executor, @NonNull AudioDeviceVolumeManager.OnDeviceVolumeBehaviorChangedListener listener)40 void addOnDeviceVolumeBehaviorChangedListener( 41 @NonNull @CallbackExecutor Executor executor, 42 @NonNull AudioDeviceVolumeManager.OnDeviceVolumeBehaviorChangedListener listener); 43 44 /** 45 * Wrapper for {@link AudioDeviceVolumeManager#removeOnDeviceVolumeBehaviorChangedListener( 46 * OnDeviceVolumeBehaviorChangedListener)} 47 */ removeOnDeviceVolumeBehaviorChangedListener( @onNull AudioDeviceVolumeManager.OnDeviceVolumeBehaviorChangedListener listener)48 void removeOnDeviceVolumeBehaviorChangedListener( 49 @NonNull AudioDeviceVolumeManager.OnDeviceVolumeBehaviorChangedListener listener); 50 51 /** 52 * Wrapper for {@link AudioDeviceVolumeManager#setDeviceAbsoluteVolumeBehavior( 53 * AudioDeviceAttributes, VolumeInfo, Executor, OnAudioDeviceVolumeChangedListener, boolean)} 54 */ setDeviceAbsoluteVolumeBehavior( @onNull AudioDeviceAttributes device, @NonNull VolumeInfo volume, @NonNull @CallbackExecutor Executor executor, @NonNull AudioDeviceVolumeManager.OnAudioDeviceVolumeChangedListener vclistener, boolean handlesVolumeAdjustment)55 void setDeviceAbsoluteVolumeBehavior( 56 @NonNull AudioDeviceAttributes device, 57 @NonNull VolumeInfo volume, 58 @NonNull @CallbackExecutor Executor executor, 59 @NonNull AudioDeviceVolumeManager.OnAudioDeviceVolumeChangedListener vclistener, 60 boolean handlesVolumeAdjustment); 61 } 62