Example usage for com.amazonaws.services.cognitoidp.model GetDeviceResult getDevice

List of usage examples for com.amazonaws.services.cognitoidp.model GetDeviceResult getDevice

Introduction

In this page you can find the example usage for com.amazonaws.services.cognitoidp.model GetDeviceResult getDevice.

Prototype


public DeviceType getDevice() 

Source Link

Document

The device.

Usage

From source file:io.fineo.client.auth.cognito.CognitoDevice.java

License:Open Source License

/**
 * Fetches device properties, in the current thread. Call this method to ensure the device properties are current.
 * Reading device properties from this object can return null values.
 *
 *  <p>//from w ww.  jav  a 2s.co  m
 *     <b>Note:</b> This method will perform network operations. Calling this method in
 *     applications' main thread will cause Android to throw NetworkOnMainThreadException.
 * </p>
 *
 * @param callback              REQUIRED: {@link GenericHandler} callback.
 */
public void getDevice(DevicesHandler callback) {
    if (callback == null) {
        throw new CognitoParameterInvalidException("callback is null");
    }

    try {
        GetDeviceResult getDeviceResult = getDeviceInternal(user.getCachedSession());
        updateThis(getDeviceResult.getDevice());
    } catch (Exception e) {
        callback.onFailure(e);
    }
}