Added in API level 36

SoundProfile


class SoundProfile : Parcelable
kotlin.Any
   ↳ android.media.quality.SoundProfile

Profile for sound quality.

Summary

Nested classes

A builder for SoundProfile

Constants
static Int

Error code for creating a profile with existing profile type and name.

static Int

Error code for invalid argument.

static Int

Error code for the case when an operation requires an allowlist but the caller is not in the list.

static Int

Error code for missing necessary permission to handle the profiles.

static Int

Error code for unknown errors.

static String

Name for the default sound profile.

static String

Name for the movie sound profile.

static String

Name for the music sound profile.

static String

Name for the news sound profile.

static String

Name for the sports sound profile.

static String

Name for the standard sound profile.

static String

Name for the user-defined sound profile.

static String

Name for the vivid sound profile.

static Int

Application profile type.

static Int

System profile type.

Inherited constants
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

String?

Gets the input ID if the profile is for a TV input.

String

Gets the profile name.

String?

Gets the package name of this profile.

PersistableBundle

Gets the parameters of this profile.

String?

Gets profile ID.

Int

Gets profile type.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<SoundProfile!>

Constants

ERROR_DUPLICATE

Added in API level 36
static val ERROR_DUPLICATE: Int

Error code for creating a profile with existing profile type and name.

Value: 2

ERROR_INVALID_ARGUMENT

Added in API level 36
static val ERROR_INVALID_ARGUMENT: Int

Error code for invalid argument.

Value: 3

ERROR_NOT_ALLOWLISTED

Added in API level 36
static val ERROR_NOT_ALLOWLISTED: Int

Error code for the case when an operation requires an allowlist but the caller is not in the list.

Value: 4

See Also

    ERROR_NO_PERMISSION

    Added in API level 36
    static val ERROR_NO_PERMISSION: Int

    Error code for missing necessary permission to handle the profiles.

    Value: 1

    ERROR_UNKNOWN

    Added in API level 36
    static val ERROR_UNKNOWN: Int

    Error code for unknown errors.

    Value: 0

    NAME_DEFAULT

    Added in API level 37
    static val NAME_DEFAULT: String

    Name for the default sound profile.

    This profile represents the system's baseline configuration and is used when no specific profile is selected.

    Value: "default"

    NAME_MOVIE

    Added in API level 37
    static val NAME_MOVIE: String

    Name for the movie sound profile.

    This profile is typically optimized for cinematic content, often enhancing surround sound effects and dialogue clarity.

    Value: "movie"

    NAME_MUSIC

    Added in API level 37
    static val NAME_MUSIC: String

    Name for the music sound profile.

    This profile is typically optimized for music playback, prioritizing audio fidelity and instrumental balance.

    Value: "music"

    NAME_NEWS

    Added in API level 37
    static val NAME_NEWS: String

    Name for the news sound profile.

    This profile is typically optimized for news broadcasts, prioritizing speech intelligibility and vocal clarity.

    Value: "news"

    NAME_SPORTS

    Added in API level 37
    static val NAME_SPORTS: String

    Name for the sports sound profile.

    This profile is typically optimized for sporting events, emphasizing commentary and crowd atmosphere.

    Value: "sports"

    NAME_STANDARD

    Added in API level 37
    static val NAME_STANDARD: String

    Name for the standard sound profile.

    This profile is typically optimized for general listening conditions and standard content types.

    Value: "standard"

    NAME_USER

    Added in API level 37
    static val NAME_USER: String

    Name for the user-defined sound profile.

    This profile represents custom settings configured by the user.

    Value: "user"

    NAME_VIVID

    Added in API level 37
    static val NAME_VIVID: String

    Name for the vivid sound profile.

    This profile typically emphasizes sound dynamics and distinct characteristics to create a more exciting audio experience.

    Value: "vivid"

    TYPE_APPLICATION

    Added in API level 36
    static val TYPE_APPLICATION: Int

    Application profile type.

    A profile of application type is managed by the package returned by getPackageName().

    Value: 2

    TYPE_SYSTEM

    Added in API level 36
    static val TYPE_SYSTEM: Int

    System profile type.

    A profile of system type is managed by the system, and readable to the package returned by getPackageName().

    Value: 1

    Public methods

    describeContents

    Added in API level 36
    fun describeContents(): Int

    Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

    Return
    Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
    Value is either 0 or

    getInputId

    Added in API level 36
    fun getInputId(): String?

    Gets the input ID if the profile is for a TV input.

    Return
    String? the corresponding TV input ID; null if the profile is not associated with a TV input.

    getName

    Added in API level 36
    fun getName(): String

    Gets the profile name.

    getPackageName

    Added in API level 36
    fun getPackageName(): String?

    Gets the package name of this profile.

    The package name defines the user of a profile. Only this specific package and system app can access to this profile.

    Return
    String? the package name; null if the profile is built locally using Builder and the package is not set.

    getParameters

    Added in API level 36
    fun getParameters(): PersistableBundle

    Gets the parameters of this profile.

    The keys of commonly used parameters can be found in MediaQualityContract.SoundQuality.

    Return
    PersistableBundle The profile parameters. Empty bundle if parameters are not included in a query.

    getProfileId

    Added in API level 36
    fun getProfileId(): String?

    Gets profile ID.

    A profile ID is a globally unique ID generated and assigned by the system. For profile objects retrieved from system (e.g MediaQualityManager.getAvailableSoundProfiles) this profile ID is non-null; For profiles built locally with Builder, it's null.

    Return
    String? the unique profile ID; null if the profile is built locally with Builder.

    getProfileType

    Added in API level 36
    fun getProfileType(): Int

    Gets profile type.

    Return
    Int Value is one of the following:

    writeToParcel

    Added in API level 36
    fun writeToParcel(
        dest: Parcel,
        flags: Int
    ): Unit

    Flatten this object in to a Parcel.

    Parameters
    dest Parcel: The Parcel in which the object should be written.
    This value cannot be null.
    flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
    Value is either 0 or a combination of the following:

    Properties

    CREATOR

    Added in API level 36
    static val CREATOR: Parcelable.Creator<SoundProfile!>