use of com.vodafone360.people.datatypes.BaseDataType in project 360-Engine-for-Android by 360.
the class LoginEngine method handleNewPublicKeyResponse.
/**
* Called when a response to the server fetch public key request is
* received. Validates the response and stores the new public key details.
*
* @param mDataTypes Response data from server.
*/
private void handleNewPublicKeyResponse(List<BaseDataType> mDataTypes) {
LogUtils.logD("LoginEngine.handleNewPublicKeyResponse()");
ServiceStatus errorStatus = getResponseStatus(BaseDataType.PUBLIC_KEY_DETAILS_DATA_TYPE, mDataTypes);
if (errorStatus == ServiceStatus.SUCCESS) {
LogUtils.logD("LoginEngine.handleNewPublicKeyResponse() - Succesfully retrieved");
// AA
// 1. save to DB; save the flag that we aren't using default and
// have to use one from DB
// 2. start registration again
mPublicKey = (PublicKeyDetails) mDataTypes.get(0);
// done in startRegistrationProcessCrypted already
// mDb.modifyCredentialsAndPublicKey(mLoginDetails, mPublicKey);
startRegistrationProcessCrypted(mRegistrationDetails);
} else {
completeUiRequest(errorStatus, null);
}
}
use of com.vodafone360.people.datatypes.BaseDataType in project 360-Engine-for-Android by 360.
the class LoginEngine method handleRequestingActivationResponse.
/**
* Called when a response to the RequestActivationCode API is received
* (manual login). In case of success, tries to fetch a login session from
* the server.
*
* @param data The received data
*/
private void handleRequestingActivationResponse(List<BaseDataType> data) {
LogUtils.logD("LoginEngine.handleRequestingActivationResponse()");
ServiceStatus errorStatus = getResponseStatus(BaseDataType.STATUS_MSG_DATA_TYPE, data);
if (errorStatus == ServiceStatus.SUCCESS) {
// Now waiting for SMS...
setTimeout(ACTIVATE_LOGIN_TIMEOUT);
return;
}
completeUiRequest(errorStatus, null);
}
use of com.vodafone360.people.datatypes.BaseDataType in project 360-Engine-for-Android by 360.
the class LoginEngine method handleCreateSessionManualResponse.
/**
* Called when a response to the GetSessionByCredentials API is received
* (manual login). In case of success, tries to activate the account using
* the activation code received by SMS.
*
* @param data The received data
*/
private void handleCreateSessionManualResponse(List<BaseDataType> data) {
LogUtils.logD("LoginEngine.handleCreateSessionManualResponse()");
ServiceStatus errorStatus = getResponseStatus(BaseDataType.AUTH_SESSION_HOLDER_TYPE, data);
if (errorStatus == ServiceStatus.SUCCESS && (data.size() > 0)) {
setActivatedSession((AuthSessionHolder) data.get(0));
startActivateAccount();
return;
}
completeUiRequest(errorStatus, null);
}
use of com.vodafone360.people.datatypes.BaseDataType in project 360-Engine-for-Android by 360.
the class LoginEngine method handleCreateSessionAutoResponse.
/**
* Called when a response to the GetSessionByCredentials API is received
* (auto login). In case of success, moves to the logged in state
*
* @param data The received data
*/
private void handleCreateSessionAutoResponse(List<BaseDataType> data) {
LogUtils.logD("LoginEngine.handleCreateSessionResponse()");
ServiceStatus errorStatus = getResponseStatus(BaseDataType.AUTH_SESSION_HOLDER_TYPE, data);
if (errorStatus == ServiceStatus.SUCCESS && (data.size() > 0)) {
clearTimeout();
setActivatedSession((AuthSessionHolder) data.get(0));
newState(State.LOGGED_ON);
} else {
LogUtils.logE("LoginEngine.handleCreateSessionResponse() - Auto Login Failed Error " + errorStatus);
// mAreLoginDetailsValid = false;
if (errorStatus == ServiceStatus.ERROR_INVALID_PASSWORD) {
mAreLoginDetailsValid = false;
newState(State.LOGIN_FAILED_WRONG_CREDENTIALS);
} else {
newState(State.LOGIN_FAILED);
}
// }
}
}
use of com.vodafone360.people.datatypes.BaseDataType in project 360-Engine-for-Android by 360.
the class UploadServerContactsTest method reportDeleteContactSuccess.
private void reportDeleteContactSuccess(int reqId, List<BaseDataType> data) {
Log.d(LOG_TAG, "reportDeleteContactSuccess");
mProcessor.verifyDeleteContactsState();
List<Long> contactIdList = new ArrayList<Long>();
mProcessor.testFetchContactDeleteList(contactIdList);
assertEquals(Math.min(mItemCount, mProcessor.testGetPageSize()), contactIdList.size());
ContactListResponse contactListResponse = new ContactListResponse();
contactListResponse.mServerRevisionAfter = 1;
contactListResponse.mServerRevisionBefore = 0;
data.add(contactListResponse);
contactListResponse.mContactIdList = new ArrayList<Integer>();
for (Long serverID : contactIdList) {
assertTrue(serverID != null);
contactListResponse.mContactIdList.add(Integer.valueOf(serverID.intValue()));
}
mItemCount -= contactIdList.size();
assertTrue(mItemCount >= 0);
if (mItemCount == 0) {
nextState(State.IDLE);
}
}
Aggregations