diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/travelbehavior/TravelBehaviorManager.java b/onebusaway-android/src/main/java/org/onebusaway/android/travelbehavior/TravelBehaviorManager.java index cc549ff8b..6731c64fd 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/travelbehavior/TravelBehaviorManager.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/travelbehavior/TravelBehaviorManager.java @@ -240,7 +240,6 @@ private void registerUser(String email) { Futures.addCallback(listenableFuture, new FutureCallback() { @Override public void onSuccess(@NullableDecl WorkInfo result) { - startCollectingData(); Activity activity = (Activity) mActivityContext; activity.runOnUiThread(() -> Toast.makeText(mApplicationContext, R.string.travel_behavior_enroll_success, Toast.LENGTH_LONG).show()); diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/travelbehavior/io/worker/RegisterTravelBehaviorParticipantWorker.java b/onebusaway-android/src/main/java/org/onebusaway/android/travelbehavior/io/worker/RegisterTravelBehaviorParticipantWorker.java index 0763c2794..1f7f4d809 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/travelbehavior/io/worker/RegisterTravelBehaviorParticipantWorker.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/travelbehavior/io/worker/RegisterTravelBehaviorParticipantWorker.java @@ -64,7 +64,7 @@ private void registerUser() { TravelBehaviorFileSaverExecutorManager manager = TravelBehaviorFileSaverExecutorManager.getInstance(); auth.signInAnonymously() - .addOnCompleteListener(task -> { + .addOnCompleteListener(manager.getThreadPoolExecutor(), task -> { if (task.isSuccessful()) { Log.v(TAG, "Firebase user init success ID: " + auth.getUid()); saveEmailAddress(auth.getUid()); @@ -85,6 +85,7 @@ private void saveEmailAddress(String uid) { String result = IOUtils.toString(reader); if (TravelBehaviorConstants.PARTICIPANT_SERVICE_RESULT.equals(result)) { TravelBehaviorManager.optInUser(uid); + TravelBehaviorManager.startCollectingData(getApplicationContext()); mFuture.set(Result.success()); } else { mFuture.set(Result.failure()); diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/util/EmbeddedSocialUtils.java b/onebusaway-android/src/main/java/org/onebusaway/android/util/EmbeddedSocialUtils.java index 286b7915d..b396e885d 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/util/EmbeddedSocialUtils.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/util/EmbeddedSocialUtils.java @@ -137,7 +137,7 @@ public static boolean isBuildVersionSupportedBySocial() { */ public static boolean isSocialApiKeyDefined() { String embeddedSocialApiKey = BuildConfig.EMBEDDED_SOCIAL_API_KEY; - return embeddedSocialApiKey != null && !embeddedSocialApiKey.isEmpty(); + return embeddedSocialApiKey != null && embeddedSocialApiKey.length() != 0; } /**