MediaQualityManager


public final class MediaQualityManager
extends Object

java.lang.Object
   ↳ android.media.quality.MediaQualityManager


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

Summary

Nested classes

interface MediaQualityManager.AmbientBacklightCallback

Callback used to monitor status of ambient backlight. 

class MediaQualityManager.PictureProfileCallback

Callback used to monitor status of picture profiles 

class MediaQualityManager.ProfileQueryParams

Options for profile queries. 

class MediaQualityManager.SoundProfileCallback

Callback used to monitor status of sound profiles. 

Public methods

void addActiveProcessingPictureListener(Executor executor, Consumer<List<ActiveProcessingPicture>> listener)

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

void createPictureProfile(PictureProfile pp)

Creates a picture profile and store it in the system.

void createSoundProfile(SoundProfile sp)

Creates a sound profile and store it in the system.

List<PictureProfile> getAvailablePictureProfiles(MediaQualityManager.ProfileQueryParams options)

Gets profiles that available to the caller.

List<SoundProfile> getAvailableSoundProfiles(MediaQualityManager.ProfileQueryParams options)

Gets profiles that available to the caller package.

EqualizerCapabilities getEqualizerCapabilities()

Gets the static equalizer capabilities of the device.

List<ParameterCapability> getParameterCapabilities(List<String> names)

Gets capability information of the given parameters.

PictureProfile getPictureProfile(int type, String name, MediaQualityManager.ProfileQueryParams options)

Gets picture profile by given profile type and name.

SoundProfile getSoundProfile(int type, String name, MediaQualityManager.ProfileQueryParams options)

Gets sound profile by given profile type and name.

boolean isAmbientBacklightEnabled()

Returns true if ambient backlight is enabled; false otherwise.

boolean isAutoPictureQualityEnabled()

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

boolean isAutoSoundQualityEnabled()

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

boolean isSuperResolutionEnabled()

Returns true if super resolution is enabled; false otherwise.

void registerAmbientBacklightCallback(Executor executor, MediaQualityManager.AmbientBacklightCallback callback)

Registers a AmbientBacklightCallback.

void registerPictureProfileCallback(Executor executor, MediaQualityManager.PictureProfileCallback callback)

Registers a PictureProfileCallback.

void registerSoundProfileCallback(Executor executor, MediaQualityManager.SoundProfileCallback callback)

Registers a SoundProfileCallback.

void removeActiveProcessingPictureListener(Consumer<List<ActiveProcessingPicture>> listener)

Removes an active picture listener for the contents.

void removePictureProfile(String profileId)

Removes a picture profile from the system.

void removeSoundProfile(String profileId)

Removes a sound profile from the system.

void setAmbientBacklightEnabled(boolean enabled)

Enables or disables the ambient backlight detection.

void setAmbientBacklightSettings(AmbientBacklightSettings settings)

Set the ambient backlight settings.

void setColorMuteEnabled(boolean enable)

Sets whether color mute is enabled.

void setMutedColor(int color)

Set the color for the "color mute" feature.

void unregisterAmbientBacklightCallback(MediaQualityManager.AmbientBacklightCallback callback)

Unregisters the existing AmbientBacklightCallback.

void unregisterPictureProfileCallback(MediaQualityManager.PictureProfileCallback callback)

Unregisters the existing PictureProfileCallback.

void unregisterSoundProfileCallback(MediaQualityManager.SoundProfileCallback callback)

Unregisters the existing SoundProfileCallback.

void updatePictureProfile(String profileId, PictureProfile pp)

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

void updateSoundProfile(String profileId, SoundProfile sp)

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

boolean usesDisplayTechnology(int panelTechnology)

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

Inherited methods

Public methods

addActiveProcessingPictureListener

Added in API level 36
public void addActiveProcessingPictureListener (Executor executor, 
                Consumer<List<ActiveProcessingPicture>> listener)

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: This value cannot be null.

createPictureProfile

Added in API level 36
public void createPictureProfile (PictureProfile pp)

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
public void createSoundProfile (SoundProfile sp)

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
public List<PictureProfile> getAvailablePictureProfiles (MediaQualityManager.ProfileQueryParams options)

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.

Returns
List<PictureProfile> the corresponding picture profile if available; null if the name doesn't exist.

getAvailableSoundProfiles

Added in API level 36
public List<SoundProfile> getAvailableSoundProfiles (MediaQualityManager.ProfileQueryParams options)

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.

Returns
List<SoundProfile> the corresponding sound profile if available; null if the none available.

getEqualizerCapabilities

Added in API level 37
public EqualizerCapabilities getEqualizerCapabilities ()

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.

Returns
EqualizerCapabilities An EqualizerCapabilities object describing the hardware's equalizer capabilities, or null if the information is not available.

Throws
SecurityException if the caller does not have the required permission.

getParameterCapabilities

Added in API level 36
public List<ParameterCapability> getParameterCapabilities (List<String> names)

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 List: the parameter names. Commonly used names can be found in MediaQualityContract. Vendor-defined names are also permitted.
This value cannot be null.

Returns
List<ParameterCapability> This value cannot be null.

getPictureProfile

Added in API level 36
public PictureProfile getPictureProfile (int type, 
                String name, 
                MediaQualityManager.ProfileQueryParams options)

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.

Returns
PictureProfile the corresponding picture profile if available; null if the name doesn't exist.

getSoundProfile

Added in API level 36
public SoundProfile getSoundProfile (int type, 
                String name, 
                MediaQualityManager.ProfileQueryParams options)

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.

Returns
SoundProfile the corresponding sound profile if available; null if the name doesn't exist.

isAmbientBacklightEnabled

Added in API level 36
public boolean isAmbientBacklightEnabled ()

Returns true if ambient backlight is enabled; false otherwise.

Returns
boolean

isAutoPictureQualityEnabled

Added in API level 36
public boolean isAutoPictureQualityEnabled ()

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

Returns
boolean

isAutoSoundQualityEnabled

Added in API level 36
public boolean isAutoSoundQualityEnabled ()

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

Returns
boolean

isSuperResolutionEnabled

Added in API level 36
public boolean isSuperResolutionEnabled ()

Returns true if super resolution is enabled; false otherwise.

Returns
boolean

registerAmbientBacklightCallback

Added in API level 36
public void registerAmbientBacklightCallback (Executor executor, 
                MediaQualityManager.AmbientBacklightCallback callback)

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
public void registerPictureProfileCallback (Executor executor, 
                MediaQualityManager.PictureProfileCallback callback)

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
public void registerSoundProfileCallback (Executor executor, 
                MediaQualityManager.SoundProfileCallback callback)

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
public void removeActiveProcessingPictureListener (Consumer<List<ActiveProcessingPicture>> listener)

Removes an active picture listener for the contents.

Parameters
listener Consumer: This value cannot be null.

removePictureProfile

Added in API level 36
public void removePictureProfile (String profileId)

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
public void removeSoundProfile (String profileId)

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
public void setAmbientBacklightEnabled (boolean enabled)

Enables or disables the ambient backlight detection.

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

setAmbientBacklightSettings

Added in API level 36
public void setAmbientBacklightSettings (AmbientBacklightSettings settings)

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
public void setColorMuteEnabled (boolean enable)

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
public void setMutedColor (int color)

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
public void unregisterAmbientBacklightCallback (MediaQualityManager.AmbientBacklightCallback callback)

Unregisters the existing AmbientBacklightCallback.

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

unregisterPictureProfileCallback

Added in API level 36
public void unregisterPictureProfileCallback (MediaQualityManager.PictureProfileCallback callback)

Unregisters the existing PictureProfileCallback.

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

unregisterSoundProfileCallback

Added in API level 36
public void unregisterSoundProfileCallback (MediaQualityManager.SoundProfileCallback callback)

Unregisters the existing SoundProfileCallback.

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

updatePictureProfile

Added in API level 36
public void updatePictureProfile (String profileId, 
                PictureProfile pp)

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
public void updateSoundProfile (String profileId, 
                SoundProfile sp)

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
public boolean usesDisplayTechnology (int panelTechnology)

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:
Returns
boolean true if the specified panel technology is supported, false otherwise.