Added in API level 36

GetValueResult


class GetValueResult : Parcelable
kotlin.Any
   ↳ android.service.settings.preferences.GetValueResult

Result object given a corresponding GetValueRequest.

  • If the request was successful, getResultCode will be RESULT_OK, getValue will be populated with the settings preference value and getMetadata will be populated with its metadata.
  • If the request is unsuccessful, getResultCode be a value other than RESULT_OK - see documentation for those possibilities to understand the cause of the failure.

Summary

Nested classes

Builder to construct GetValueResult.

Constants
static Int

Requested preference is not allowed for access in this API under the current device policy.

static Int

API call failed due to an issue with the service binding.

static Int

Request object is not valid.

static Int

Request is successful.

static Int

Requested preference requires permissions not held by the calling application.

static Int

Preference is currently not available, likely due to device state or the state of a dependency.

static Int

Requested preference is not supported by this API.

Inherited constants
Public methods
SettingsPreferenceMetadata?

Returns the metadata of requested Preference if request successful.

Int

Returns the result code indicating status of the request.

SettingsPreferenceValue?

Returns the value of requested Preference if request successful.

Properties
static Parcelable.Creator<GetValueResult!>

Parcelable Creator for GetValueResult.

Constants

RESULT_DISALLOW

Added in API level 36
static val RESULT_DISALLOW: Int

Requested preference is not allowed for access in this API under the current device policy.

Retry may succeed if underlying conditions change.

Value: 4

RESULT_INTERNAL_ERROR

Added in API level 36
static val RESULT_INTERNAL_ERROR: Int

API call failed due to an issue with the service binding.

Retry may succeed.

Value: 6

RESULT_INVALID_REQUEST

Added in API level 36
static val RESULT_INVALID_REQUEST: Int

Request object is not valid.

Retry not advised with current parameters.

Value: 5

RESULT_OK

Added in API level 36
static val RESULT_OK: Int

Request is successful.

Value: 0

RESULT_REQUIRE_APP_PERMISSION

Added in API level 36
static val RESULT_REQUIRE_APP_PERMISSION: Int

Requested preference requires permissions not held by the calling application.

Retry may succeed if necessary permissions are obtained.

Value: 3

RESULT_UNAVAILABLE

Added in API level 36
static val RESULT_UNAVAILABLE: Int

Preference is currently not available, likely due to device state or the state of a dependency.

Retry may succeed if underlying conditions change.

Value: 2

RESULT_UNSUPPORTED

Added in API level 36
static val RESULT_UNSUPPORTED: Int

Requested preference is not supported by this API.

Retry not advised.

Value: 1

Public methods

getMetadata

Added in API level 36
fun getMetadata(): SettingsPreferenceMetadata?

Returns the metadata of requested Preference if request successful.

getValue

Added in API level 36
fun getValue(): SettingsPreferenceValue?

Returns the value of requested Preference if request successful.

Properties

CREATOR

Added in API level 36
static val CREATOR: Parcelable.Creator<GetValueResult!>

Parcelable Creator for GetValueResult.