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.AmbientBacklightCallbackCallback used to monitor status of ambient backlight. | 
| 
        
        
        
        
        class | MediaQualityManager.PictureProfileCallbackCallback used to monitor status of picture profiles | 
| 
        
        
        
        
        class | MediaQualityManager.ProfileQueryParamsOptions for profile queries. | 
| 
        
        
        
        
        class | MediaQualityManager.SoundProfileCallbackCallback 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  | 
| 
        
        
        
        
        
        boolean | 
      isAutoPictureQualityEnabled()
      Returns  | 
| 
        
        
        
        
        
        boolean | 
      isAutoSoundQualityEnabled()
      Returns  | 
| 
        
        
        
        
        
        boolean | 
      isSuperResolutionEnabled()
      Returns  | 
| 
        
        
        
        
        
        void | 
      registerAmbientBacklightCallback(Executor executor, MediaQualityManager.AmbientBacklightCallback callback)
      Registers a  | 
| 
        
        
        
        
        
        void | 
      registerPictureProfileCallback(Executor executor, MediaQualityManager.PictureProfileCallback callback)
      Registers a  | 
| 
        
        
        
        
        
        void | 
      registerSoundProfileCallback(Executor executor, MediaQualityManager.SoundProfileCallback callback)
      Registers a  | 
| 
        
        
        
        
        
        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  | 
| 
        
        
        
        
        
        void | 
      unregisterPictureProfileCallback(MediaQualityManager.PictureProfileCallback callback)
      Unregisters the existing  | 
| 
        
        
        
        
        
        void | 
      unregisterSoundProfileCallback(MediaQualityManager.SoundProfileCallback callback)
      Unregisters the existing  | 
| 
        
        
        
        
        
        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 thisExecutor, providing an easy way to control which thread is
 used. To dispatch events through the main thread of your
 application, you can useContext.getMainExecutor().
 Otherwise, provide anExecutorthat dispatches to an appropriate thread.
 This value cannot benull. | 
| listener | Consumer: This value cannot benull. | 
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: thePictureProfileobject to be created.
 This value cannot benull. | 
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: theSoundProfileobject to be created.
 This value cannot benull. | 
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.nullif default options are used. | 
| Returns | |
|---|---|
| List<PictureProfile> | the corresponding picture profile if available; nullif 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.nullif default options are used. | 
| Returns | |
|---|---|
| List<SoundProfile> | the corresponding sound profile if available; nullif 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 inMediaQualityContract. Vendor-defined names are also permitted.
 This value cannot benull. | 
| 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 isPictureProfile.TYPE_SYSTEM, orPictureProfile.TYPE_APPLICATION | 
| name | String: the name of the profile.
 This value cannot benull. | 
| options | MediaQualityManager.ProfileQueryParams: the options of the query.nullif default options are used. | 
| Returns | |
|---|---|
| PictureProfile | the corresponding picture profile if available; nullif 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 isSoundProfile.TYPE_SYSTEM, orSoundProfile.TYPE_APPLICATION | 
| name | String: the name of the profile.
 This value cannot benull. | 
| options | MediaQualityManager.ProfileQueryParams: the options of the query.nullif default options are used. | 
| Returns | |
|---|---|
| SoundProfile | the corresponding sound profile if available; nullif 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 benull.
 Callback and listener events are dispatched through thisExecutor, providing an easy way to control which thread is
 used. To dispatch events through the main thread of your
 application, you can useContext.getMainExecutor().
 Otherwise, provide anExecutorthat dispatches to an appropriate thread. | 
| callback | MediaQualityManager.AmbientBacklightCallback: This value cannot benull. | 
registerPictureProfileCallback
public void registerPictureProfileCallback (Executor executor, MediaQualityManager.PictureProfileCallback callback)
Registers a PictureProfileCallback.
| Parameters | |
|---|---|
| executor | Executor: This value cannot benull.
 Callback and listener events are dispatched through thisExecutor, providing an easy way to control which thread is
 used. To dispatch events through the main thread of your
 application, you can useContext.getMainExecutor().
 Otherwise, provide anExecutorthat dispatches to an appropriate thread. | 
| callback | MediaQualityManager.PictureProfileCallback: This value cannot benull. | 
registerSoundProfileCallback
public void registerSoundProfileCallback (Executor executor, MediaQualityManager.SoundProfileCallback callback)
Registers a SoundProfileCallback.
| Parameters | |
|---|---|
| executor | Executor: This value cannot benull.
 Callback and listener events are dispatched through thisExecutor, providing an easy way to control which thread is
 used. To dispatch events through the main thread of your
 application, you can useContext.getMainExecutor().
 Otherwise, provide anExecutorthat dispatches to an appropriate thread. | 
| callback | MediaQualityManager.SoundProfileCallback: This value cannot benull. | 
removeActiveProcessingPictureListener
public void removeActiveProcessingPictureListener (Consumer<List<ActiveProcessingPicture>> listener)
Removes an active picture listener for the contents.
| Parameters | |
|---|---|
| listener | Consumer: This value cannot benull. | 
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 benull. | 
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 benull. | 
setAmbientBacklightEnabled
public void setAmbientBacklightEnabled (boolean enabled)
Enables or disables the ambient backlight detection.
| Parameters | |
|---|---|
| enabled | boolean:trueto enable,falseto 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 benull. | 
unregisterAmbientBacklightCallback
public void unregisterAmbientBacklightCallback (MediaQualityManager.AmbientBacklightCallback callback)
Unregisters the existing AmbientBacklightCallback.
| Parameters | |
|---|---|
| callback | MediaQualityManager.AmbientBacklightCallback: This value cannot benull. | 
unregisterPictureProfileCallback
public void unregisterPictureProfileCallback (MediaQualityManager.PictureProfileCallback callback)
Unregisters the existing PictureProfileCallback.
| Parameters | |
|---|---|
| callback | MediaQualityManager.PictureProfileCallback: This value cannot benull. | 
unregisterSoundProfileCallback
public void unregisterSoundProfileCallback (MediaQualityManager.SoundProfileCallback callback)
Unregisters the existing SoundProfileCallback.
| Parameters | |
|---|---|
| callback | MediaQualityManager.SoundProfileCallback: This value cannot benull. | 
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 benull. | 
| pp | PictureProfile: thePictureProfileobject to be updated.
 This value cannot benull. | 
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 benull. | 
| sp | SoundProfile: theSoundProfileobject to be updated.
 This value cannot benull. | 
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
