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

Commit 67c75e46 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Move more types from android.media -> a.m.audio.common SAIDL

Move types that are known to be used by audio HALs
(those listed in h/i/audio/common/7.0/types.hal):

 - AudioContentType
 - AudioEncapsulationMetadataType
 - AudioEncapsulationType
 - AudioMode
 - AudioSource (renamed from AudioSourceType to
     match the name of MediaRecorder.AudioSource)
 - AudioUuid

Bug: 198812639
Test: m
Change-Id: I3331d7e3d76db50f5b3c4db57891a20e4f935ad8
parent ed370a40
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -55,12 +55,18 @@ aidl_interface {
        "aidl/android/media/audio/common/AudioChannelLayout.aidl",
        "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/AudioEncapsulationMetadataType.aidl",
        "aidl/android/media/audio/common/AudioEncapsulationMode.aidl",
        "aidl/android/media/audio/common/AudioEncapsulationType.aidl",
        "aidl/android/media/audio/common/AudioFormatDescription.aidl",
        "aidl/android/media/audio/common/AudioFormatType.aidl",
        "aidl/android/media/audio/common/AudioMode.aidl",
        "aidl/android/media/audio/common/AudioOffloadInfo.aidl",
        "aidl/android/media/audio/common/AudioSource.aidl",
        "aidl/android/media/audio/common/AudioStreamType.aidl",
        "aidl/android/media/audio/common/AudioUsage.aidl",
        "aidl/android/media/audio/common/AudioUuid.aidl",
        "aidl/android/media/audio/common/PcmType.aidl",
    ],
    stability: "vintf",
+53 −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;

/**
 * Content type specifies "what" is playing. The content type expresses the
 * general category of the content: speech, music, movie audio, etc.
 * This enum corresponds to AudioAttributes.CONTENT_TYPE_* constants in the SDK.
 *
 * {@hide}
 */
@Backing(type="int")
@VintfStability
enum AudioContentType {
    /**
     * Content type value to use when the content type is unknown, or other than
     * the ones defined.
     */
    UNKNOWN = 0,
    /**
     * Content type value to use when the content type is speech.
     */
    SPEECH = 1,
    /**
     * Content type value to use when the content type is music.
     */
    MUSIC = 2,
    /**
     * Content type value to use when the content type is a soundtrack,
     * typically accompanying a movie or TV program.
     */
    MOVIE = 3,
    /**
     * Content type value to use when the content type is a sound used to
     * accompany a user action, such as a beep or sound effect expressing a key
     * click, or event, such as the type of a sound for a bonus being received
     * in a game. These sounds are mostly synthesized or short Foley sounds.
     */
    SONIFICATION = 4,
}
+40 −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;

/**
 * Enumeration of metadata types permitted for use by encapsulation mode audio
 * streams (see AudioEncapsulationMode). This type corresponds to
 * AudioTrack.ENCAPSULATION_METADATA_TYPE_* constants in the SDK.
 *
 * {@hide}
 */
@Backing(type="int")
@VintfStability
enum AudioEncapsulationMetadataType {
    /** Default value. */
    NONE = 0,
    /**
     * Encapsulation metadata type for framework tuner information.
     */
    FRAMEWORK_TUNER = 1,
    /**
     * Encapsulation metadata type for DVB AD descriptor.
     *
     * This metadata is formatted per ETSI TS 101 154 Table E.1: AD_descriptor.
     */
    DVB_AD_DESCRIPTOR = 2,
}
+33 −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;

/**
 * Audio encapsulation type is used to describe if the audio data should be sent
 * with a particular encapsulation type or not. This enum corresponds to
 * AudioProfile.AUDIO_ENCAPSULATION_* constants in the SDK.
 *
 * {@hide}
 */
@Backing(type="int")
@VintfStability
enum AudioEncapsulationType {
    /** No encapsulation type is specified. */
    NONE = 0,
    /** Encapsulation used the format defined in the standard IEC 61937. */
    IEC61937 = 1,
}
+48 −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;

/**
 * Major modes for a mobile device. The current mode setting affects audio
 * routing.
 *
 * {@hide}
 */
@Backing(type="int")
@VintfStability
enum AudioMode {
    /**
     * Used as default value in parcelables to indicate that a value was not
     * set. Should never be considered a valid setting, except for backward
     * compatibility scenarios.
     */
    SYS_RESERVED_INVALID = -2,
    /**
     * Value reserved for system use only. HALs must never return this value to
     * the system or accept it from the system.
     */
    SYS_RESERVED_CURRENT = -1,
    /** Normal mode (no call in progress). */
    NORMAL = 0,
    /** Mobile device is receiving an incoming connection request. */
    RINGTONE = 1,
    /** Calls handled by the telephony stack (PSTN). */
    IN_CALL = 2,
    /** Calls handled by apps (VoIP). */
    IN_COMMUNICATION = 3,
    /** Call screening in progress. */
    CALL_SCREEN = 4,
}
Loading