SetValueResult


public final class SetValueResult
extends Object implements Parcelable

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


Result object given a corresponding SetValueRequest.

Summary

Nested classes

class SetValueResult.Builder

Builder to construct SetValueResult

Constants

int RESULT_DISABLED

Requested preference is disabled, thus unable to be set in this state.

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 and the value was set.

int RESULT_REQUIRE_APP_PERMISSION

Requested preference requires permissions not held by the calling application.

int RESULT_REQUIRE_USER_CONSENT

User consent was not approved for this operation.

int RESULT_RESTRICTED

Requested preference is restricted, thus unable to be set under this policy.

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<SetValueResult> CREATOR

Parcelable Creator for SetValueResult.

Public methods

int getResultCode()

Returns the result code indicating status of the request.

Inherited methods

Constants

RESULT_DISABLED

Added in API level 36
public static final int RESULT_DISABLED

Requested preference is disabled, thus unable to be set in this state.

Retry may succeed if underlying conditions change.

Constant Value: 2 (0x00000002)

RESULT_DISALLOW

Added in API level 36
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: 7 (0x00000007)

RESULT_INTERNAL_ERROR

Added in API level 36
public static final int RESULT_INTERNAL_ERROR

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

Retry may succeed.

Constant Value: 9 (0x00000009)

RESULT_INVALID_REQUEST

Added in API level 36
public static final int RESULT_INVALID_REQUEST

Request object is not valid.

Retry not advised with current parameters.

Constant Value: 8 (0x00000008)

RESULT_OK

Added in API level 36
public static final int RESULT_OK

Request is successful and the value was set.

Constant Value: 0 (0x00000000)

RESULT_REQUIRE_APP_PERMISSION

Added in API level 36
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: 5 (0x00000005)

Added in API level 36
public static final int RESULT_REQUIRE_USER_CONSENT

User consent was not approved for this operation.

Retry may succeed if user provides consent.

Constant Value: 6 (0x00000006)

RESULT_RESTRICTED

Added in API level 36
public static final int RESULT_RESTRICTED

Requested preference is restricted, thus unable to be set under this policy.

Retry may succeed if underlying conditions change.

Constant Value: 3 (0x00000003)

RESULT_UNAVAILABLE

Added in API level 36
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: 4 (0x00000004)

RESULT_UNSUPPORTED

Added in API level 36
public static final int RESULT_UNSUPPORTED

Requested preference is not supported by this API.

Retry not advised.

Constant Value: 1 (0x00000001)

Fields

CREATOR

Added in API level 36
public static final Creator<SetValueResult> CREATOR

Parcelable Creator for SetValueResult.

Public methods

getResultCode

Added in API level 36
public int getResultCode ()

Returns the result code indicating status of the request.

Returns
int Value is RESULT_OK, RESULT_UNSUPPORTED, RESULT_DISABLED, RESULT_RESTRICTED, RESULT_UNAVAILABLE, RESULT_REQUIRE_APP_PERMISSION, RESULT_REQUIRE_USER_CONSENT, RESULT_DISALLOW, RESULT_INVALID_REQUEST, or RESULT_INTERNAL_ERROR