Source:
public ProfileModel call( ) { try { ServiceManager api = environment.getServiceManager(); AuthResponse social = null; HashMap<String, CharSequence> descParams = new HashMap<>(); String platformName = environment.getConfig().getPlatformName(); descParams.put("platform_name", environment.getConfig().getPlatformName()); descParams.put("platform_destination", environment.getConfig().getPlatformDestinationName()); if (backend.equalsIgnoreCase(PrefManager.Value.BACKEND_FACEBOOK)) { social = api.loginByFacebook(accessToken); if ( social.error != null && social.error.equals("401") ) { CharSequence title = ResourceUtil.getFormattedString(context.getResources(), R.string.error_account_not_linked_title_fb, "platform_name", platformName); CharSequence desc = ResourceUtil.getFormattedString(context.getResources(), R.string.error_account_not_linked_desc_fb, descParams); throw new LoginException(new LoginErrorMessage(title.toString(), desc.toString())); } } else if (backend.equalsIgnoreCase(PrefManager.Value.BACKEND_GOOGLE)) { social = api.loginByGoogle(accessToken); if ( social.error != null && social.error.equals("401") ) { CharSequence title = ResourceUtil.getFormattedString(context.getResources(), R.string.error_account_not_linked_title_google, "platform_name", platformName); CharSequence desc = ResourceUtil.getFormattedString(context.getResources(), R.string.error_account_not_linked_desc_google, descParams); throw new LoginException(new LoginErrorMessage(title.toString(), desc.toString())); } } if (social.isSuccess()) { ProfileModel profile = api.getProfile(); if (profile.email != null) { return profile; } } throw new LoginException(new LoginErrorMessage( context.getString(R.string.login_error), context.getString(R.string.login_failed))); } catch (Exception e) { logger.error(e); handle(e); } return null; }

Target:
public ProfileModel call( ) { try { ServiceManager api = environment.getServiceManager(); AuthResponse social = null; HashMap<String, CharSequence> descParams = new HashMap<>(); String platformName = environment.getConfig().getPlatformName(); descParams.put("platform_name", environment.getConfig().getPlatformName()); descParams.put("platform_destination", environment.getConfig().getPlatformDestinationName()); if (backend.equalsIgnoreCase(PrefManager.Value.BACKEND_FACEBOOK)) { social = api.loginByFacebook(accessToken); if ( social.error != null && social.error.equals("401") ) { CharSequence title = ResourceUtil.getFormattedString(context.getResources(), R.string.error_account_not_linked_title_fb, descParams); CharSequence desc = ResourceUtil.getFormattedString(context.getResources(), R.string.error_account_not_linked_desc_fb, descParams); throw new LoginException(new LoginErrorMessage(title.toString(), desc.toString())); } } else if (backend.equalsIgnoreCase(PrefManager.Value.BACKEND_GOOGLE)) { social = api.loginByGoogle(accessToken); if ( social.error != null && social.error.equals("401") ) { CharSequence title = ResourceUtil.getFormattedString(context.getResources(), R.string.error_account_not_linked_title_google, descParams); CharSequence desc = ResourceUtil.getFormattedString(context.getResources(), R.string.error_account_not_linked_desc_google, descParams); throw new LoginException(new LoginErrorMessage(title.toString(), desc.toString())); } } if (social.isSuccess()) { ProfileModel profile = api.getProfile(); if (profile.email != null) { return profile; } } throw new LoginException(new LoginErrorMessage( context.getString(R.string.login_error), context.getString(R.string.login_failed))); } catch (Exception e) { logger.error(e); handle(e); } return null; }