1 /*
2  * Copyright (C) 2021 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.media.audiotestharness.server.config;
18 
19 import com.android.media.audiotestharness.common.Defaults;
20 import com.android.media.audiotestharness.proto.AudioDeviceOuterClass;
21 
22 import com.google.auto.value.AutoValue;
23 import com.google.common.collect.ImmutableList;
24 
25 /**
26  * Container class that encapsulates configuration or other metadata from the test-host that needs
27  * to be accessible by the Audio Test Harness system.
28  */
29 @AutoValue
30 public abstract class SharedHostConfiguration {
31 
create( ImmutableList<AudioDeviceOuterClass.AudioDevice> captureDevices)32     public static SharedHostConfiguration create(
33             ImmutableList<AudioDeviceOuterClass.AudioDevice> captureDevices) {
34         return new AutoValue_SharedHostConfiguration(captureDevices);
35     }
36 
getDefault()37     public static SharedHostConfiguration getDefault() {
38         return new AutoValue_SharedHostConfiguration(ImmutableList.of(Defaults.AUDIO_DEVICE));
39     }
40 
41     /**
42      * The list of capture devices that should be allocated by the system for capture.
43      *
44      * <p>At the moment, the system only supports a single capture device, so only the first device
45      * is actually used.
46      */
captureDevices()47     public abstract ImmutableList<AudioDeviceOuterClass.AudioDevice> captureDevices();
48 }
49