GetValueResult
public
final
class
GetValueResult
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.service.settings.preferences.GetValueResult |
Result object given a corresponding GetValueRequest.
- If the request was successful,
getResultCode()will beRESULT_OK,getValue()will be populated with the settings preference value andgetMetadata()will be populated with its metadata. - If the request is unsuccessful,
getResultCode()be a value other thanRESULT_OK- see documentation for those possibilities to understand the cause of the failure.
Summary
Nested classes | |
|---|---|
class |
GetValueResult.Builder
Builder to construct |
Constants | |
|---|---|
int |
RESULT_DISALLOW
Requested preference is not allowed for access in this API under the current device policy. |
int |
RESULT_INTERNAL_ERROR
API call failed due to an issue with the service binding. |
int |
RESULT_INVALID_REQUEST
Request object is not valid. |
int |
RESULT_OK
Request is successful. |
int |
RESULT_REQUIRE_APP_PERMISSION
Requested preference requires permissions not held by the calling application. |
int |
RESULT_UNAVAILABLE
Preference is currently not available, likely due to device state or the state of a dependency. |
int |
RESULT_UNSUPPORTED
Requested preference is not supported by this API. |
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<GetValueResult> |
CREATOR
Parcelable Creator for |
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
SettingsPreferenceMetadata
|
getMetadata()
Returns the metadata of requested Preference if request successful. |
int
|
getResultCode()
Returns the result code indicating status of the request. |
SettingsPreferenceValue
|
getValue()
Returns the value of requested Preference if request successful. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
Constants
RESULT_DISALLOW
public static final int RESULT_DISALLOW
Requested preference is not allowed for access in this API under the current device policy.
Retry may succeed if underlying conditions change.
Constant Value: 4 (0x00000004)
RESULT_INTERNAL_ERROR
public static final int RESULT_INTERNAL_ERROR
API call failed due to an issue with the service binding.
Retry may succeed.
Constant Value: 6 (0x00000006)
RESULT_INVALID_REQUEST
public static final int RESULT_INVALID_REQUEST
Request object is not valid.
Retry not advised with current parameters.
Constant Value: 5 (0x00000005)
RESULT_OK
public static final int RESULT_OK
Request is successful.
Constant Value: 0 (0x00000000)
RESULT_REQUIRE_APP_PERMISSION
public static final int RESULT_REQUIRE_APP_PERMISSION
Requested preference requires permissions not held by the calling application.
Retry may succeed if necessary permissions are obtained.
Constant Value: 3 (0x00000003)
RESULT_UNAVAILABLE
public static final int RESULT_UNAVAILABLE
Preference is currently not available, likely due to device state or the state of a dependency.
Retry may succeed if underlying conditions change.
Constant Value: 2 (0x00000002)
RESULT_UNSUPPORTED
public static final int RESULT_UNSUPPORTED
Requested preference is not supported by this API.
Retry not advised.
Constant Value: 1 (0x00000001)
Fields
CREATOR
public static final Creator<GetValueResult> CREATOR
Parcelable Creator for GetValueResult.
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
|
getMetadata
public SettingsPreferenceMetadata getMetadata ()
Returns the metadata of requested Preference if request successful.
| Returns | |
|---|---|
SettingsPreferenceMetadata |
|
getResultCode
public int getResultCode ()
Returns the result code indicating status of the request.
| Returns | |
|---|---|
int |
Value is one of the following: |
getValue
public SettingsPreferenceValue getValue ()
Returns the value of requested Preference if request successful.
| Returns | |
|---|---|
SettingsPreferenceValue |
|
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 the following:
|
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 2026-02-13 UTC.