Added in API level 36

MediaQualityManager


class MediaQualityManager
kotlin.Any
   ↳ android.media.quality.MediaQualityManager

Central system API to the overall media quality, which arbitrates interaction between applications and media quality service.

Summary

Nested classes
abstract

Callback used to monitor status of ambient backlight.

abstract

Callback used to monitor status of picture profiles

Options for profile queries.

abstract

Callback used to monitor status of sound profiles.

Public methods
Unit

Adds an active picture listener for the contents owner by the caller.

Unit

Creates a picture profile and store it in the system.

Unit

Creates a sound profile and store it in the system.

MutableList<PictureProfile!>

Gets profiles that available to the caller.

MutableList<SoundProfile!>

Gets profiles that available to the caller package.

EqualizerCapabilities?

Gets the static equalizer capabilities of the device.

MutableList<ParameterCapability!>

Gets capability information of the given parameters.

PictureProfile?

Gets picture profile by given profile type and name.

SoundProfile?

Gets sound profile by given profile type and name.

Boolean

Returns true if ambient backlight is enabled; false otherwise.

Boolean

Returns true if auto picture quality is enabled; false otherwise.

Boolean

Returns true if auto sound quality is enabled; false otherwise.

Boolean

Returns true if super resolution is enabled; false otherwise.

Unit

Registers a AmbientBacklightCallback.

Unit

Registers a PictureProfileCallback.

Unit

Registers a SoundProfileCallback.

Unit

Removes an active picture listener for the contents.

Unit

Removes a picture profile from the system.

Unit

Removes a sound profile from the system.

Unit

Enables or disables the ambient backlight detection.

Unit

Set the ambient backlight settings.

Unit

Sets whether color mute is enabled.

Unit

Set the color for the "color mute" feature.

Unit

Unregisters the existing AmbientBacklightCallback.

Unit

Unregisters the existing PictureProfileCallback.

Unit

Unregisters the existing SoundProfileCallback.

Unit

Updates an existing picture profile and store it in the system.

Unit

Updates an existing sound profile and store it in the system.

Boolean
usesDisplayTechnology(panelTechnology: Int)

Checks if a specific display panel technology is supported by the device.

Public methods

addActiveProcessingPictureListener

Added in API level 36
fun addActiveProcessingPictureListener(
    executor: Executor,
    listener: Consumer<MutableList<ActiveProcessingPicture!>!>
): Unit

Adds an active picture listener for the contents owner by the caller.

Parameters
executor Executor: Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.
This value cannot be null.
listener Consumer<MutableList<ActiveProcessingPicture!>!>: This value cannot be null.

createPictureProfile

Added in API level 36
fun createPictureProfile(pp: PictureProfile): Unit

Creates a picture profile and store it in the system.

If the profile is created successfully, PictureProfileCallback.onPictureProfileAdded(String,PictureProfile) is invoked.

Parameters
pp PictureProfile: the PictureProfile object to be created.
This value cannot be null.

createSoundProfile

Added in API level 36
fun createSoundProfile(sp: SoundProfile): Unit

Creates a sound profile and store it in the system.

If the profile is created successfully, SoundProfileCallback.onSoundProfileAdded(String,SoundProfile) is invoked.

Parameters
sp SoundProfile: the SoundProfile object to be created.
This value cannot be null.

getAvailablePictureProfiles

Added in API level 36
fun getAvailablePictureProfiles(options: MediaQualityManager.ProfileQueryParams?): MutableList<PictureProfile!>

Gets profiles that available to the caller.

If ProfileQueryParams.areParametersIncluded() is false, PictureProfile.getParameters() of the returned profiles are empty bundles.

Parameters
options MediaQualityManager.ProfileQueryParams?: the options of the query. null if default options are used.
Return
MutableList<PictureProfile!> the corresponding picture profile if available; null if the name doesn't exist.

getAvailableSoundProfiles

Added in API level 36
fun getAvailableSoundProfiles(options: MediaQualityManager.ProfileQueryParams?): MutableList<SoundProfile!>

Gets profiles that available to the caller package.

If ProfileQueryParams.areParametersIncluded() is false, SoundProfile.getParameters() of the returned profiles are empty bundles.

Parameters
options MediaQualityManager.ProfileQueryParams?: the options of the query. null if default options are used.
Return
MutableList<SoundProfile!> the corresponding sound profile if available; null if the none available.

getEqualizerCapabilities

Added in API level 37
fun getEqualizerCapabilities(): EqualizerCapabilities?

Gets the static equalizer capabilities of the device.

This includes information like the supported gain range (min/max levels) and the center frequencies of all available equalizer bands. This information is static and is not expected to change at runtime.

Return
EqualizerCapabilities? An EqualizerCapabilities object describing the hardware's equalizer capabilities, or null if the information is not available.
Exceptions
java.lang.SecurityException if the caller does not have the required permission.

getParameterCapabilities

Added in API level 36
fun getParameterCapabilities(names: MutableList<String!>): MutableList<ParameterCapability!>

Gets capability information of the given parameters.

If a name isn't found, a corresponding ParameterCapability instance is in the return list, and ParameterCapability.isSupported() is false.

Parameters
names MutableList<String!>: the parameter names. Commonly used names can be found in MediaQualityContract. Vendor-defined names are also permitted.
This value cannot be null.
Return
MutableList<ParameterCapability!> This value cannot be null.

getPictureProfile

Added in API level 36
fun getPictureProfile(
    type: Int,
    name: String,
    options: MediaQualityManager.ProfileQueryParams?
): PictureProfile?

Gets picture profile by given profile type and name.

If ProfileQueryParams.areParametersIncluded() is false, PictureProfile.getParameters() of the returned profile is an empty bundle.

Parameters
type Int: the type of the profile.
Value is one of the following:
name String: the name of the profile.
This value cannot be null.
options MediaQualityManager.ProfileQueryParams?: the options of the query. null if default options are used.
Return
PictureProfile? the corresponding picture profile if available; null if the name doesn't exist.

getSoundProfile

Added in API level 36
fun getSoundProfile(
    type: Int,
    name: String,
    options: MediaQualityManager.ProfileQueryParams?
): SoundProfile?

Gets sound profile by given profile type and name.

If ProfileQueryParams.areParametersIncluded() is false, SoundProfile.getParameters() of the returned profile is an empty bundle.

Parameters
type Int: the type of the profile.
Value is one of the following:
name String: the name of the profile.
This value cannot be null.
options MediaQualityManager.ProfileQueryParams?: the options of the query. null if default options are used.
Return
SoundProfile? the corresponding sound profile if available; null if the name doesn't exist.

isAmbientBacklightEnabled

Added in API level 36
fun isAmbientBacklightEnabled(): Boolean

Returns true if ambient backlight is enabled; false otherwise.

isAutoPictureQualityEnabled

Added in API level 36
fun isAutoPictureQualityEnabled(): Boolean

Returns true if auto picture quality is enabled; false otherwise.

isAutoSoundQualityEnabled

Added in API level 36
fun isAutoSoundQualityEnabled(): Boolean

Returns true if auto sound quality is enabled; false otherwise.

isSuperResolutionEnabled

Added in API level 36
fun isSuperResolutionEnabled(): Boolean

Returns true if super resolution is enabled; false otherwise.

registerAmbientBacklightCallback

Added in API level 36
fun registerAmbientBacklightCallback(
    executor: Executor,
    callback: MediaQualityManager.AmbientBacklightCallback
): Unit

Registers a AmbientBacklightCallback.

Parameters
executor Executor: This value cannot be null.
Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.
callback MediaQualityManager.AmbientBacklightCallback: This value cannot be null.

registerPictureProfileCallback

Added in API level 36
fun registerPictureProfileCallback(
    executor: Executor,
    callback: MediaQualityManager.PictureProfileCallback
): Unit

Registers a PictureProfileCallback.

Parameters
executor Executor: This value cannot be null.
Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.
callback MediaQualityManager.PictureProfileCallback: This value cannot be null.

registerSoundProfileCallback

Added in API level 36
fun registerSoundProfileCallback(
    executor: Executor,
    callback: MediaQualityManager.SoundProfileCallback
): Unit

Registers a SoundProfileCallback.

Parameters
executor Executor: This value cannot be null.
Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.
callback MediaQualityManager.SoundProfileCallback: This value cannot be null.

removeActiveProcessingPictureListener

Added in API level 36
fun removeActiveProcessingPictureListener(listener: Consumer<MutableList<ActiveProcessingPicture!>!>): Unit

Removes an active picture listener for the contents.

Parameters
listener Consumer<MutableList<ActiveProcessingPicture!>!>: This value cannot be null.

removePictureProfile

Added in API level 36
fun removePictureProfile(profileId: String): Unit

Removes a picture profile from the system.

Parameters
profileId String: the id of the object to be removed.
This value cannot be null.

removeSoundProfile

Added in API level 36
fun removeSoundProfile(profileId: String): Unit

Removes a sound profile from the system.

Parameters
profileId String: the id of the object to be removed.
This value cannot be null.

setAmbientBacklightEnabled

Added in API level 36
fun setAmbientBacklightEnabled(enabled: Boolean): Unit

Enables or disables the ambient backlight detection.

Parameters
enabled Boolean: true to enable, false to disable.

setAmbientBacklightSettings

Added in API level 36
fun setAmbientBacklightSettings(settings: AmbientBacklightSettings): Unit

Set the ambient backlight settings.

Parameters
settings AmbientBacklightSettings: The settings to use for the backlight detector.
This value cannot be null.

setColorMuteEnabled

Added in API level 37
fun setColorMuteEnabled(enable: Boolean): Unit

Sets whether color mute is enabled.

This feature enables the display of a colored screen in the absence of a signal to display. The color can be configured by setMutedColor(int).

Parameters
enable Boolean: Whether color mute is enabled.

setMutedColor

Added in API level 37
fun setMutedColor(color: Int): Unit

Set the color for the "color mute" feature.

The selected color will be displayed when the color mute feature is enabled, and in the absence of a signal for the display.

Parameters
color Int: The ARGB color to be set.

unregisterAmbientBacklightCallback

Added in API level 36
fun unregisterAmbientBacklightCallback(callback: MediaQualityManager.AmbientBacklightCallback): Unit

Unregisters the existing AmbientBacklightCallback.

Parameters
callback MediaQualityManager.AmbientBacklightCallback: This value cannot be null.

unregisterPictureProfileCallback

Added in API level 36
fun unregisterPictureProfileCallback(callback: MediaQualityManager.PictureProfileCallback): Unit

Unregisters the existing PictureProfileCallback.

Parameters
callback MediaQualityManager.PictureProfileCallback: This value cannot be null.

unregisterSoundProfileCallback

Added in API level 36
fun unregisterSoundProfileCallback(callback: MediaQualityManager.SoundProfileCallback): Unit

Unregisters the existing SoundProfileCallback.

Parameters
callback MediaQualityManager.SoundProfileCallback: This value cannot be null.

updatePictureProfile

Added in API level 36
fun updatePictureProfile(
    profileId: String,
    pp: PictureProfile
): Unit

Updates an existing picture profile and store it in the system.

Parameters
profileId String: the id of the object to be updated.
This value cannot be null.
pp PictureProfile: the PictureProfile object to be updated.
This value cannot be null.

updateSoundProfile

Added in API level 36
fun updateSoundProfile(
    profileId: String,
    sp: SoundProfile
): Unit

Updates an existing sound profile and store it in the system.

Parameters
profileId String: the id of the object to be updated.
This value cannot be null.
sp SoundProfile: the SoundProfile object to be updated.
This value cannot be null.

usesDisplayTechnology

Added in API level 37
fun usesDisplayTechnology(panelTechnology: Int): Boolean

Checks if a specific display panel technology is supported by the device.

This is a blocking call and should not be called on the main thread.

Parameters
panelTechnology Int: The type of display panel technology to query. This must be one of the constants from MediaQualityContract.PanelTechnology.
Value is one of the following:
Return
Boolean true if the specified panel technology is supported, false otherwise.