protected GoogleApi getGoogleApi(String email) { GoogleApi api = (GoogleApi) getParameter(GmailSender.PARAM_GOOGLE_API); if (api == null) { api = new GoogleApi(getContext()); setParameter(GmailSender.PARAM_GOOGLE_API, api); } if (api.getCredential() == null || api.getAccountName().compareTo(email) != 0) { api.setAccountName(email); } return api; }
public boolean cancel() { boolean cancelled = cancel(true); // necessary to effectively stop HttpUrlConnections final PeppermintApi peppermintApi = (PeppermintApi) getParameter(Sender.PARAM_PEPPERMINT_API); if (peppermintApi != null) { peppermintApi.cancelPendingRequests(mIdentity.getId().toString()); } final GoogleApi googleApi = (GoogleApi) getParameter(Sender.PARAM_GOOGLE_API); if (googleApi != null) { googleApi.cancelPendingRequests(mIdentity.getId().toString()); } final SparkPostApi sparkPostApi = (SparkPostApi) getParameter(Sender.PARAM_SPARKPOST_API); if (sparkPostApi != null) { sparkPostApi.cancelPendingRequests(mIdentity.getId().toString()); } return cancelled; }