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 |
addActiveProcessingPictureListener(executor: Executor, listener: Consumer<MutableList<ActiveProcessingPicture!>!>) 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. |
MutableList<ParameterCapability!> |
getParameterCapabilities(names: MutableList<String!>) Gets capability information of the given parameters. |
PictureProfile? |
getPictureProfile(type: Int, name: String, options: MediaQualityManager.ProfileQueryParams?) Gets picture profile by given profile type and name. |
SoundProfile? |
getSoundProfile(type: Int, name: String, options: MediaQualityManager.ProfileQueryParams?) Gets sound profile by given profile type and name. |
Boolean |
Returns |
Boolean |
Returns |
Boolean |
Returns |
Boolean |
Returns |
Unit |
registerAmbientBacklightCallback(executor: Executor, callback: MediaQualityManager.AmbientBacklightCallback) Registers a |
Unit |
registerPictureProfileCallback(executor: Executor, callback: MediaQualityManager.PictureProfileCallback) Registers a |
Unit |
registerSoundProfileCallback(executor: Executor, callback: MediaQualityManager.SoundProfileCallback) Registers a |
Unit |
Removes an active picture listener for the contents. |
Unit |
removePictureProfile(profileId: String) Removes a picture profile from the system. |
Unit |
removeSoundProfile(profileId: String) Removes a sound profile from the system. |
Unit |
setAmbientBacklightEnabled(enabled: Boolean) Enables or disables the ambient backlight detection. |
Unit |
Set the ambient backlight settings. |
Unit |
Unregisters the existing |
Unit |
Unregisters the existing |
Unit |
Unregisters the existing |
Unit |
updatePictureProfile(profileId: String, pp: PictureProfile) Updates an existing picture profile and store it in the system. |
Unit |
updateSoundProfile(profileId: String, sp: SoundProfile) Updates an existing sound profile and store it in the system. |
Public methods
addActiveProcessingPictureListener
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
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
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
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
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. |
getParameterCapabilities
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
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 android.media.quality.PictureProfile#TYPE_SYSTEM , or android.media.quality.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. |
Return | |
---|---|
PictureProfile? |
the corresponding picture profile if available; null if the name doesn't exist. |
getSoundProfile
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 android.media.quality.SoundProfile#TYPE_SYSTEM , or android.media.quality.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. |
Return | |
---|---|
SoundProfile? |
the corresponding sound profile if available; null if the name doesn't exist. |
isAmbientBacklightEnabled
fun isAmbientBacklightEnabled(): Boolean
Returns true
if ambient backlight is enabled; false
otherwise.
isAutoPictureQualityEnabled
fun isAutoPictureQualityEnabled(): Boolean
Returns true
if auto picture quality is enabled; false
otherwise.
isAutoSoundQualityEnabled
fun isAutoSoundQualityEnabled(): Boolean
Returns true
if auto sound quality is enabled; false
otherwise.
isSuperResolutionEnabled
fun isSuperResolutionEnabled(): Boolean
Returns true
if super resolution is enabled; false
otherwise.
registerAmbientBacklightCallback
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
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
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
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
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
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
fun setAmbientBacklightEnabled(enabled: Boolean): Unit
Enables or disables the ambient backlight detection.
Parameters | |
---|---|
enabled |
Boolean: true to enable, false to disable. |
setAmbientBacklightSettings
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 . |
unregisterAmbientBacklightCallback
fun unregisterAmbientBacklightCallback(callback: MediaQualityManager.AmbientBacklightCallback): Unit
Unregisters the existing AmbientBacklightCallback
.
Parameters | |
---|---|
callback |
MediaQualityManager.AmbientBacklightCallback: This value cannot be null . |
unregisterPictureProfileCallback
fun unregisterPictureProfileCallback(callback: MediaQualityManager.PictureProfileCallback): Unit
Unregisters the existing PictureProfileCallback
.
Parameters | |
---|---|
callback |
MediaQualityManager.PictureProfileCallback: This value cannot be null . |
unregisterSoundProfileCallback
fun unregisterSoundProfileCallback(callback: MediaQualityManager.SoundProfileCallback): Unit
Unregisters the existing SoundProfileCallback
.
Parameters | |
---|---|
callback |
MediaQualityManager.SoundProfileCallback: This value cannot be null . |
updatePictureProfile
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
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 . |