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.

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 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.

Inherited methods

Public methods

addActiveProcessingPictureListener

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

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

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

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

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.

getParameterCapabilities

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

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 PictureProfile.TYPE_SYSTEM, or PictureProfile.TYPE_APPLICATION

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

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 SoundProfile.TYPE_SYSTEM, or SoundProfile.TYPE_APPLICATION

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

public boolean isAmbientBacklightEnabled ()

Returns true if ambient backlight is enabled; false otherwise.

Returns
boolean

isAutoPictureQualityEnabled

public boolean isAutoPictureQualityEnabled ()

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

Returns
boolean

isAutoSoundQualityEnabled

public boolean isAutoSoundQualityEnabled ()

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

Returns
boolean

isSuperResolutionEnabled

public boolean isSuperResolutionEnabled ()

Returns true if super resolution is enabled; false otherwise.

Returns
boolean

registerAmbientBacklightCallback

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

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

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

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

Removes an active picture listener for the contents.

Parameters
listener Consumer: This value cannot be null.

removePictureProfile

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

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

public void setAmbientBacklightEnabled (boolean enabled)

Enables or disables the ambient backlight detection.

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

setAmbientBacklightSettings

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.

unregisterAmbientBacklightCallback

public void unregisterAmbientBacklightCallback (MediaQualityManager.AmbientBacklightCallback callback)

Unregisters the existing AmbientBacklightCallback.

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

unregisterPictureProfileCallback

public void unregisterPictureProfileCallback (MediaQualityManager.PictureProfileCallback callback)

Unregisters the existing PictureProfileCallback.

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

unregisterSoundProfileCallback

public void unregisterSoundProfileCallback (MediaQualityManager.SoundProfileCallback callback)

Unregisters the existing SoundProfileCallback.

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

updatePictureProfile

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

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.