Source:
public static void setEmail(@NonNull final String email, @Nullable final String emailAuthHash, @Nullable final EmailUpdateHandler callback) { if (taskController.shouldQueueTaskForInit(OSTaskController.SET_EMAIL)) { logger.error("Waiting for remote params. " + "Moving " + OSTaskController.SET_EMAIL + " operation to a pending task queue."); if (callback != null) callback.onTaskQueued(); taskController.addTaskToQueue(new Runnable() { @Override public void run() { logger.debug("Running " + OSTaskController.SET_EMAIL + " operation from a pending task queue."); setEmail(email, emailAuthHash, callback); } }); } if (shouldLogUserPrivacyConsentErrorMessageForMethodName(OSTaskController.SET_EMAIL)) return; if (!OSUtils.isValidEmail(email)) { String errorMessage = "Email is invalid"; if (callback != null) callback.onFailure(new EmailUpdateError(EmailErrorType.VALIDATION, errorMessage)); logger.error(errorMessage); return; } if (getRemoteParams() != null && getRemoteParams().useEmailAuth && emailAuthHash == null) { String errorMessage = "Email authentication (auth token) is set to REQUIRED for this application. Please provide an auth token from your backend server or change the setting in the OneSignal dashboard."; if (callback != null) callback.onFailure(new EmailUpdateError(EmailErrorType.REQUIRES_EMAIL_AUTH, errorMessage)); logger.error(errorMessage); return; } emailUpdateHandler = callback; String trimmedEmail = email.trim(); String internalEmailAuthHash = emailAuthHash; if (internalEmailAuthHash != null) internalEmailAuthHash = internalEmailAuthHash.toLowerCase(); getCurrentEmailSubscriptionState(appContext).setEmailAddress(trimmedEmail); OneSignalStateSynchronizer.setEmail(trimmedEmail.toLowerCase(), internalEmailAuthHash); }

Target:
public static void setEmail(@NonNull final String email, @Nullable final String emailAuthHash, @Nullable final EmailUpdateHandler callback) { if (taskController.shouldQueueTaskForInit(OSTaskController.SET_EMAIL)) { logger.error("Waiting for remote params. " + "Moving " + OSTaskController.SET_EMAIL + " operation to a pending task queue."); taskController.addTaskToQueue(new Runnable() { @Override public void run() { logger.debug("Running " + OSTaskController.SET_EMAIL + " operation from a pending task queue."); setEmail(email, emailAuthHash, callback); } }); return; } if (shouldLogUserPrivacyConsentErrorMessageForMethodName(OSTaskController.SET_EMAIL)) return; if (!OSUtils.isValidEmail(email)) { String errorMessage = "Email is invalid"; if (callback != null) callback.onFailure(new EmailUpdateError(EmailErrorType.VALIDATION, errorMessage)); logger.error(errorMessage); return; } if (getRemoteParams().useEmailAuth && emailAuthHash == null) { String errorMessage = "Email authentication (auth token) is set to REQUIRED for this application. Please provide an auth token from your backend server or change the setting in the OneSignal dashboard."; if (callback != null) callback.onFailure(new EmailUpdateError(EmailErrorType.REQUIRES_EMAIL_AUTH, errorMessage)); logger.error(errorMessage); return; } emailUpdateHandler = callback; String trimmedEmail = email.trim(); String internalEmailAuthHash = emailAuthHash; if (internalEmailAuthHash != null) internalEmailAuthHash = internalEmailAuthHash.toLowerCase(); getCurrentEmailSubscriptionState(appContext).setEmailAddress(trimmedEmail); OneSignalStateSynchronizer.setEmail(trimmedEmail.toLowerCase(), internalEmailAuthHash); }