SettingsPreferenceMetadata


public final class SettingsPreferenceMetadata
extends Object implements Parcelable

java.lang.Object
   ↳ android.service.settings.preferences.SettingsPreferenceMetadata


Data object representation of a Settings Preference definition and state.

Summary

Nested classes

class SettingsPreferenceMetadata.Builder

Builder to construct SettingsPreferenceMetadata

Constants

int DEEPLINK_ONLY

Indicates preference is write-sensitive.

int EXPECT_POST_CONFIRMATION

Indicates preference is mildly write-sensitive.

int NO_DIRECT_ACCESS

Indicates preference is highly write-sensitivity and carries significant user-risk.

int NO_SENSITIVITY

Indicates preference is not write-sensitive.

Inherited constants

int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel(Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)".

Fields

public static final Creator<SettingsPreferenceMetadata> CREATOR

Parcelable Creator for SettingsPreferenceMetadata.

Public methods

Bundle getExtras()

Returns any additional fields specific to this preference.

String getKey()

Returns the key of Preference.

Intent getLaunchIntent()

Returns the intent to launch the host app page for this Preference.

List<String> getReadPermissions()

Returns the permissions required to read this Preference's value.

String getScreenKey()

Returns the screen key of Preference.

String getSummary()

Returns the summary of Preference.

String getTitle()

Returns the title of Preference.

List<String> getWritePermissions()

Returns the permissions required to write this Preference's value.

int getWriteSensitivity()

Returns the write-level sensitivity of Preference.

boolean isAvailable()

Returns whether Preference is available.

boolean isEnabled()

Returns whether Preference is enabled.

boolean isRestricted()

Returns whether Preference is restricted.

boolean isWritable()

Returns whether Preference is writable.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

abstract int describeContents()

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

abstract void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Constants

public static final int DEEPLINK_ONLY

Indicates preference is write-sensitive.

This preference cannot be changed through this API; instead a deeplink to the Preference's page should be used instead, accessible via getLaunchIntent().

Constant Value: 2 (0x00000002)

EXPECT_POST_CONFIRMATION

public static final int EXPECT_POST_CONFIRMATION

Indicates preference is mildly write-sensitive.

In addition to necessary permissions, after writing its value the user should be given the option to revert back.

Constant Value: 1 (0x00000001)

NO_DIRECT_ACCESS

public static final int NO_DIRECT_ACCESS

Indicates preference is highly write-sensitivity and carries significant user-risk.

This Preference cannot be changed through this API and no direct deeplink is available. Other Metadata is still available.

Constant Value: 3 (0x00000003)

NO_SENSITIVITY

public static final int NO_SENSITIVITY

Indicates preference is not write-sensitive.

Its value is writable without explicit consent, assuming all necessary permissions are granted.

Constant Value: 0 (0x00000000)

Fields

CREATOR

public static final Creator<SettingsPreferenceMetadata> CREATOR

Parcelable Creator for SettingsPreferenceMetadata.

Public methods

getExtras

public Bundle getExtras ()

Returns any additional fields specific to this preference.

Treat all data as optional. This may contain unstructured data for a given preference, where the type and format of this data may only known by inspecting the source code of that preference. As such, any access of this data must handle failures gracefully to account for changing or missing data.

Returns
Bundle

getKey

public String getKey ()

Returns the key of Preference.

Returns
String

getLaunchIntent

public Intent getLaunchIntent ()

Returns the intent to launch the host app page for this Preference.

Returns
Intent

getReadPermissions

public List<String> getReadPermissions ()

Returns the permissions required to read this Preference's value.

May be empty.

Returns
List<String>

getScreenKey

public String getScreenKey ()

Returns the screen key of Preference.

Returns
String

getSummary

public String getSummary ()

Returns the summary of Preference.

Returns
String

getTitle

public String getTitle ()

Returns the title of Preference.

Returns
String

getWritePermissions

public List<String> getWritePermissions ()

Returns the permissions required to write this Preference's value.

May be empty.

Returns
List<String>

getWriteSensitivity

public int getWriteSensitivity ()

Returns the write-level sensitivity of Preference.

isAvailable

public boolean isAvailable ()

Returns whether Preference is available.

Returns
boolean

isEnabled

public boolean isEnabled ()

Returns whether Preference is enabled.

Returns
boolean

isRestricted

public boolean isRestricted ()

Returns whether Preference is restricted.

If true, this means the Preference is treated as a Restricted Preference which indicates that it could be conditionally disabled/unavailable due to admin settings.

Returns
boolean

isWritable

public boolean isWritable ()

Returns whether Preference is writable.

Returns
boolean