Skip to content

Commit

Permalink
Fix OneBusAway#943 Workaround for String.isEmpty() being broken in ne…
Browse files Browse the repository at this point in the history
…wer versions of Gradle
  • Loading branch information
acrown-msft authored and cagryInside committed Jun 27, 2019
1 parent 036bdd8 commit 9b300d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ private void registerUser(String email) {
Futures.addCallback(listenableFuture, new FutureCallback<WorkInfo>() {
@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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 9b300d5

Please sign in to comment.