PictureProfile


public final class PictureProfile
extends Object implements Parcelable

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


Profile for picture quality.

Summary

Nested classes

class PictureProfile.Builder

A builder for PictureProfile

Constants

int ERROR_DUPLICATE

Error code for creating a profile with existing profile type and name.

int ERROR_INVALID_ARGUMENT

Error code for invalid argument.

int ERROR_NOT_ALLOWLISTED

Error code for the case when an operation requires an allowlist but the caller is not in the list.

int ERROR_NO_PERMISSION

Error code for missing necessary permission to handle the profiles.

int ERROR_UNKNOWN

Error code for unknown errors.

int TYPE_APPLICATION

Application profile type.

int TYPE_SYSTEM

System profile type.

Inherited constants

Fields

public static final Creator<PictureProfile> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

String getInputId()

Gets the input ID if the profile is for a TV input.

String getName()

Gets the profile name.

String getPackageName()

Gets the package name of this profile.

PersistableBundle getParameters()

Gets the parameters of this profile.

String getProfileId()

Gets profile ID.

int getProfileType()

Gets profile type.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

ERROR_DUPLICATE

public static final int ERROR_DUPLICATE

Error code for creating a profile with existing profile type and name.

Constant Value: 2 (0x00000002)

ERROR_INVALID_ARGUMENT

public static final int ERROR_INVALID_ARGUMENT

Error code for invalid argument.

Constant Value: 3 (0x00000003)

ERROR_NOT_ALLOWLISTED

public static final int ERROR_NOT_ALLOWLISTED

Error code for the case when an operation requires an allowlist but the caller is not in the list.

Constant Value: 4 (0x00000004)

ERROR_NO_PERMISSION

public static final int ERROR_NO_PERMISSION

Error code for missing necessary permission to handle the profiles.

Constant Value: 1 (0x00000001)

ERROR_UNKNOWN

public static final int ERROR_UNKNOWN

Error code for unknown errors.

Constant Value: 0 (0x00000000)

TYPE_APPLICATION

public static final int TYPE_APPLICATION

Application profile type.

A profile of application type is managed by the package returned by getPackageName().

Constant Value: 2 (0x00000002)

TYPE_SYSTEM

public static final int TYPE_SYSTEM

System profile type.

A profile of system type is managed by the system, and readable to the package returned by getPackageName().

Constant Value: 1 (0x00000001)

Fields

CREATOR

public static final Creator<PictureProfile> CREATOR

Public methods

describeContents

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getInputId

public String getInputId ()

Gets the input ID if the profile is for a TV input.

Returns
String the corresponding TV input ID; null if the profile is not associated with a TV input.

getName

public String getName ()

Gets the profile name.

Returns
String

getPackageName

public String getPackageName ()

Gets the package name of this profile.

The package name defines the user of a profile. Only this specific package and system app can access to this profile.

Returns
String the package name; null if the profile is built locally using Builder and the package is not set.

getParameters

public PersistableBundle getParameters ()

Gets the parameters of this profile.

The keys of commonly used parameters can be found in MediaQualityContract.PictureQuality.

Returns
PersistableBundle The profile parameters. Empty bundle if parameters are not included in a query.

getProfileId

public String getProfileId ()

Gets profile ID.

A profile ID is a globally unique ID generated and assigned by the system. For profile objects retrieved from system (e.g MediaQualityManager.getAvailablePictureProfiles) this profile ID is non-null; For profiles built locally with Builder, it's null.

Returns
String the unique profile ID; null if the profile is built locally with Builder.

getProfileType

public int getProfileType ()

Gets profile type.

Returns
int Value is TYPE_SYSTEM, or TYPE_APPLICATION

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES