CrossDeviceAuthenticationException


public final class CrossDeviceAuthenticationException
extends Exception

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ android.security.authenticationpolicy.CrossDeviceAuthenticationException


Exception thrown when cross-device authentication fails.

Summary

Constants

int ERROR_COMPANION_DEVICE_MANAGER_NOT_PRESENT

CompanionDeviceManager is not present on this device.

int ERROR_DECRYPTION_FAILED

Decryption of the payload failed.

int ERROR_INVALID_PACKAGE

The calling package is invalid or not allowlisted.

int ERROR_INVALID_TIMESTAMP

The request timestamp is invalid.

int ERROR_NOT_IN_FOREGROUND

The calling package was not visible in the foreground.

int ERROR_SERIALIZATION_FAILED

Serialization or deserialization of the request failed.

int ERROR_UNAUTHORIZED

The request is not authorized.

int ERROR_UNKNOWN

Unknown error occurred.

Public constructors

CrossDeviceAuthenticationException(int errorCode)
CrossDeviceAuthenticationException(int errorCode, String message)
CrossDeviceAuthenticationException(int errorCode, String message, Throwable cause)

Public methods

int getErrorCode()

Returns the error code associated with this exception.

Inherited methods

Constants

ERROR_COMPANION_DEVICE_MANAGER_NOT_PRESENT

Added in version 37.2
public static final int ERROR_COMPANION_DEVICE_MANAGER_NOT_PRESENT

CompanionDeviceManager is not present on this device.

Constant Value: 7 (0x00000007)

ERROR_DECRYPTION_FAILED

Added in version 37.2
public static final int ERROR_DECRYPTION_FAILED

Decryption of the payload failed.

Constant Value: 2 (0x00000002)

ERROR_INVALID_PACKAGE

Added in version 37.2
public static final int ERROR_INVALID_PACKAGE

The calling package is invalid or not allowlisted.

Constant Value: 3 (0x00000003)

ERROR_INVALID_TIMESTAMP

Added in version 37.2
public static final int ERROR_INVALID_TIMESTAMP

The request timestamp is invalid.

Constant Value: 4 (0x00000004)

ERROR_NOT_IN_FOREGROUND

Added in version 37.2
public static final int ERROR_NOT_IN_FOREGROUND

The calling package was not visible in the foreground. Some form of foreground visibility is always required, but the exact definition of varies based on the device's form factor.

Constant Value: 6 (0x00000006)

ERROR_SERIALIZATION_FAILED

Added in version 37.2
public static final int ERROR_SERIALIZATION_FAILED

Serialization or deserialization of the request failed.

Constant Value: 5 (0x00000005)

ERROR_UNAUTHORIZED

Added in version 37.2
public static final int ERROR_UNAUTHORIZED

The request is not authorized. This error indicates that the user must take some action on the source device before the request can be fulfilled. The required conditions vary by form factor, but typically require that the has either unlocked the source device directly or has an an active connection to another trusted device. See the associated message for more details. A more specific error code from this class will be returned instead this error for common error conditions that do not vary.

Constant Value: 1 (0x00000001)

ERROR_UNKNOWN

Added in version 37.2
public static final int ERROR_UNKNOWN

Unknown error occurred.

Constant Value: 0 (0x00000000)

Public constructors

CrossDeviceAuthenticationException

Added in version 37.2
public CrossDeviceAuthenticationException (int errorCode)

Parameters
errorCode int: Value is one of the following:

CrossDeviceAuthenticationException

Added in version 37.2
public CrossDeviceAuthenticationException (int errorCode, 
                String message)

Parameters
errorCode int: Value is one of the following:
message String: This value cannot be null.

CrossDeviceAuthenticationException

Added in version 37.2
public CrossDeviceAuthenticationException (int errorCode, 
                String message, 
                Throwable cause)

Parameters
errorCode int: Value is one of the following:
message String: This value cannot be null.

cause Throwable: This value cannot be null.

Public methods

getErrorCode

Added in version 37.2
public int getErrorCode ()

Returns the error code associated with this exception.

Returns
int Value is one of the following: