Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49ba38fc authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Move AudioDevice* from android.media -> a.m.audio.common SAIDL

Also add missing "@hide" on a few interfaces

Bug: 198812639
Test: m
Change-Id: Ie5205571e17300008a1c80ef4dbe50c0a248ba6b
parent 0a426db7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ aidl_interface {
        "aidl/android/media/audio/common/AudioConfig.aidl",
        "aidl/android/media/audio/common/AudioConfigBase.aidl",
        "aidl/android/media/audio/common/AudioContentType.aidl",
        "aidl/android/media/audio/common/AudioDevice.aidl",
        "aidl/android/media/audio/common/AudioDeviceDescription.aidl",
        "aidl/android/media/audio/common/AudioDeviceType.aidl",
        "aidl/android/media/audio/common/AudioEncapsulationMetadataType.aidl",
        "aidl/android/media/audio/common/AudioEncapsulationMode.aidl",
        "aidl/android/media/audio/common/AudioEncapsulationType.aidl",
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.media.audio.common;

import android.media.audio.common.AudioDeviceDescription;

/**
 * Represents a concrete audio device by bundling together the device type and
 * the device address.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioDevice {
    AudioDeviceDescription type;
    @utf8InCpp String address;
}
+108 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.media.audio.common;

import android.media.audio.common.AudioDeviceType;

/**
 * Describes the kind of an audio device.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioDeviceDescription {
    /**
     * Type and directionality of the device. For bidirectional audio devices
     * two descriptions need to be created, having the same value for
     * the 'connection' field.
     *
     * See 'AudioDeviceType' for the list of supported values.
     */
    AudioDeviceType type = AudioDeviceType.NONE;
    /**
     * Specifies the type of the connection of the device to the audio system.
     * Usually it's some kind of a communication protocol, e.g. Bluetooth SCO or
     * USB. There is a list of connection types recognized by the framework,
     * defined using 'CONNECTION_' constants. Vendors can add their own
     * connection types with "vx.<vendor>." prefix.
     *
     * When the 'connection' field is left empty and 'type != NONE | DEFAULT',
     * it is assumed that the device is permanently attached to the audio
     * system, e.g. a built-in speaker or microphone.
     *
     * The 'connection' field must be left empty if 'type' is 'NONE' or
     * '{IN|OUT}_DEFAULT'.
     */
    @utf8InCpp String connection;
    /**
     * Analog connection, for example, via 3.5 mm analog jack.
     */
    const @utf8InCpp String CONNECTION_ANALOG = "analog";
    /**
     * Low-End (Analog) Desk Dock.
     */
    const @utf8InCpp String CONNECTION_ANALOG_DOCK = "analog-dock";
    /**
     * Bluetooth A2DP connection.
     */
    const @utf8InCpp String CONNECTION_BT_A2DP = "bt-a2dp";
    /**
     * Bluetooth Low Energy (LE) connection.
     */
    const @utf8InCpp String CONNECTION_BT_LE = "bt-le";
    /**
     * Bluetooth SCO connection.
     */
    const @utf8InCpp String CONNECTION_BT_SCO = "bt-sco";
    /**
     * Bus connection. Mostly used in automotive scenarios.
     */
    const @utf8InCpp String CONNECTION_BUS = "bus";
    /**
     * High-End (Digital) Desk Dock.
     */
    const @utf8InCpp String CONNECTION_DIGITAL_DOCK = "digital-dock";
    /**
     * HDMI connection.
     */
    const @utf8InCpp String CONNECTION_HDMI = "hdmi";
    /**
     * HDMI ARC connection.
     */
    const @utf8InCpp String CONNECTION_HDMI_ARC = "hdmi-arc";
    /**
     * HDMI eARC connection.
     */
    const @utf8InCpp String CONNECTION_HDMI_EARC = "hdmi-earc";
    /**
     * IP v4 connection.
     */
    const @utf8InCpp String CONNECTION_IP_V4 = "ip-v4";
    /**
     * SPDIF connection.
     */
    const @utf8InCpp String CONNECTION_SPDIF = "spdif";
    /**
     * A wireless connection when the actual protocol is unspecified.
     */
    const @utf8InCpp String CONNECTION_WIRELESS = "wireless";
    /**
     * USB connection.
     */
    const @utf8InCpp String CONNECTION_USB = "usb";
}
+161 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.media.audio.common;

/**
 * The type of the audio device. Only used as part of 'AudioDeviceDescription'
 * structure.
 *
 * Types are divided into "input" and "output" categories. Audio devices that
 * have both audio input and output, for example, headsets, are represented by a
 * pair of input and output device types.
 *
 * The 'AudioDeviceType' intentionally binds together directionality and 'kind'
 * of the device to avoid making them fully orthogonal. This is because not all
 * types of devices are bidirectional, for example, speakers can only be used
 * for output and microphones can only be used for input (at least, in the
 * context of the audio framework).
 *
 * {@hide}
 */
@VintfStability
@Backing(type="int")
enum AudioDeviceType {
    /**
     * "None" type is a "null" value. All fields of 'AudioDeviceDescription'
     * must have default / empty / null values.
     */
    NONE = 0,
    /**
     * The "default" device is used when the client does not have any
     * preference for a particular device.
     */
    IN_DEFAULT = 1,
    /**
     * A device implementing Android Open Accessory protocol.
     */
    IN_ACCESSORY = 2,
    /**
     * Input from a DSP front-end proxy device.
     */
    IN_AFE_PROXY = 3,
    /**
     * Used when only the connection protocol is known, e.g. a "HDMI Device."
     */
    IN_DEVICE = 4,
    /**
     * A device providing reference input for echo canceller.
     */
    IN_ECHO_REFERENCE = 5,
    /**
     * FM Tuner input.
     */
    IN_FM_TUNER = 6,
    /**
     * A microphone of a headset.
     */
    IN_HEADSET = 7,
    /**
     * Loopback input.
     */
    IN_LOOPBACK = 8,
    /**
     * The main microphone (the frontal mic on mobile devices).
     */
    IN_MICROPHONE = 9,
    /**
     * The secondary microphone (the back mic on mobile devices).
     */
    IN_MICROPHONE_BACK = 10,
    /**
     * Input from a submix of other streams.
     */
    IN_SUBMIX = 11,
    /**
     * Audio received via the telephone line.
     */
    IN_TELEPHONY_RX = 12,
    /**
     * TV Tuner audio input.
     */
    IN_TV_TUNER = 13,
    /**
     * The "default" device is used when the client does not have any
     * preference for a particular device.
     */
    OUT_DEFAULT = 129,
    /**
     * A device implementing Android Open Accessory protocol.
     */
    OUT_ACCESSORY = 130,
    /**
     * Output from a DSP front-end proxy device.
     */
    OUT_AFE_PROXY = 131,
    /**
     * Car audio system.
     */
    OUT_CARKIT = 132,
    /**
     * Used when only the connection protocol is known, e.g. a "HDMI Device."
     */
    OUT_DEVICE = 133,
    /**
     * The echo canceller device.
     */
    OUT_ECHO_CANCELLER = 134,
    /**
     * The FM Tuner device.
     */
    OUT_FM = 135,
    /**
     * Headphones.
     */
    OUT_HEADPHONE = 136,
    /**
     * Headphones of a headset.
     */
    OUT_HEADSET = 137,
    /**
     * Hearing aid.
     */
    OUT_HEARING_AID = 138,
    /**
     * Secondary line level output.
     */
    OUT_LINE_AUX = 139,
    /**
     * The main speaker.
     */
    OUT_SPEAKER = 140,
    /**
     * The speaker of a mobile device in the case when it is close to the ear.
     */
    OUT_SPEAKER_EARPIECE = 141,
    /**
     * The main speaker with overload / overheating protection.
     */
    OUT_SPEAKER_SAFE = 142,
    /**
     * Output into a submix.
     */
    OUT_SUBMIX = 143,
    /**
     * Output into a telephone line.
     */
    OUT_TELEPHONY_TX = 144,
}
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package android.media.audio.common;
/**
 * The type of the audio format. Only used as part of 'AudioFormatDescription'
 * structure.
 *
 * {@hide}
 */
@VintfStability
@Backing(type="byte")
Loading