Update AudioPort <-> configs mapping

It is considered that in general there is a 1:N relationship
between an AudioPort and AudioPortConfigs.
The 'AudioPort.activeConfig' field could only support a 1:1
relationship, thus it got removed. Instead,
an 'AudioPortConfig.portId' field added to reference the ID
of the AudioPort to which this config is linked to.

Bug: 205884982
Test: m
Change-Id: I8ac76abaf8194c8c98deff15b2b5d3c828b9669c
This commit is contained in:
Mikhail Naganov
2021-12-04 01:42:58 +00:00
parent defa76abad
commit 9a63dde753
4 changed files with 9 additions and 7 deletions

View File

@@ -18,7 +18,6 @@ package android.media.audio.common;
import android.media.audio.common.AudioGain;
import android.media.audio.common.AudioIoFlags;
import android.media.audio.common.AudioPortConfig;
import android.media.audio.common.AudioPortExt;
import android.media.audio.common.AudioProfile;
import android.media.audio.common.ExtraAudioDescriptor;
@@ -33,7 +32,7 @@ import android.media.audio.common.ExtraAudioDescriptor;
@VintfStability
parcelable AudioPort {
/**
* Unique identifier of the port within this HAL service.
* Unique identifier of the port within a HAL module.
*/
int id;
/**
@@ -57,8 +56,6 @@ parcelable AudioPort {
ExtraAudioDescriptor[] extraAudioDescriptors;
/** Gain controllers. */
AudioGain[] gains;
/** Current audio port configuration. */
AudioPortConfig activeConfig;
/** Extra parameters depending on the port role. */
AudioPortExt ext;
}

View File

@@ -33,10 +33,15 @@ import android.media.audio.common.Int;
@VintfStability
parcelable AudioPortConfig {
/**
* Port unique ID. This field is set to a non-zero value when it is needed
* to select a previously reported port and apply new configuration to it.
* Port config unique ID. This field is set to a non-zero value when it is
* needed to select a previously reported port config and apply new
* configuration to it.
*/
int id;
/**
* The ID of the AudioPort instance this configuration applies to.
*/
int portId;
/** Sample rate in Hz. Can be left unspecified. */
@nullable Int sampleRate;
/** Channel mask. Can be left unspecified. */

View File

@@ -41,6 +41,5 @@ parcelable AudioPort {
android.media.audio.common.AudioIoFlags flags;
android.media.audio.common.ExtraAudioDescriptor[] extraAudioDescriptors;
android.media.audio.common.AudioGain[] gains;
android.media.audio.common.AudioPortConfig activeConfig;
android.media.audio.common.AudioPortExt ext;
}

View File

@@ -36,6 +36,7 @@ package android.media.audio.common;
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable AudioPortConfig {
int id;
int portId;
@nullable android.media.audio.common.Int sampleRate;
@nullable android.media.audio.common.AudioChannelLayout channelMask;
@nullable android.media.audio.common.AudioFormatDescription format;