From 1da9764ed00c9367e49421581d171b2490c8600d Mon Sep 17 00:00:00 2001 From: Javi Rueda Date: Wed, 10 Jun 2020 16:49:32 +0200 Subject: [PATCH] Remove more Firebase related code --- .../io/lbry/browser/ui/other/AboutFragment.java | 8 -------- .../java/io/lbry/browser/utils/LbryAnalytics.java | 15 +-------------- .../main/java/io/lbry/browser/utils/Lbryio.java | 6 ------ 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/app/src/main/java/io/lbry/browser/ui/other/AboutFragment.java b/app/src/main/java/io/lbry/browser/ui/other/AboutFragment.java index 8091014f..b29f631d 100644 --- a/app/src/main/java/io/lbry/browser/ui/other/AboutFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/other/AboutFragment.java @@ -21,8 +21,6 @@ import androidx.preference.PreferenceManager; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.android.material.snackbar.Snackbar; -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.iid.InstanceIdResult; import org.json.JSONObject; @@ -198,12 +196,6 @@ public class AboutFragment extends BaseFragment implements SdkStatusListener { onSdkReady(); } } - FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(new OnCompleteListener() { - @Override - public void onComplete(Task task) { - Helper.setViewText(textFirebaseToken, task.isSuccessful() ? task.getResult().getToken() : getString(R.string.unknown)); - } - }); } diff --git a/app/src/main/java/io/lbry/browser/utils/LbryAnalytics.java b/app/src/main/java/io/lbry/browser/utils/LbryAnalytics.java index 17b66b69..609a920a 100644 --- a/app/src/main/java/io/lbry/browser/utils/LbryAnalytics.java +++ b/app/src/main/java/io/lbry/browser/utils/LbryAnalytics.java @@ -4,8 +4,6 @@ import android.app.Activity; import android.content.Context; import android.os.Bundle; -import com.google.firebase.analytics.FirebaseAnalytics; - public class LbryAnalytics { public static final String EVENT_APP_ERROR = "app_error"; @@ -28,23 +26,15 @@ public class LbryAnalytics { public static final String EVENT_CHANNEL_CREATE = "channel_create"; public static final String EVENT_SEARCH = "search"; - private static FirebaseAnalytics analytics; - public static void init(Context context) { - analytics = FirebaseAnalytics.getInstance(context); + } public static void checkInitAnalytics(Context context) { - if (analytics == null && context != null) { - analytics = FirebaseAnalytics.getInstance(context); - } } public static void setCurrentScreen(Activity activity, String name, String className) { checkInitAnalytics(activity); - if (analytics != null) { - analytics.setCurrentScreen(activity, name, className); - } } public static void logEvent(String name) { @@ -52,9 +42,6 @@ public class LbryAnalytics { } public static void logEvent(String name, Bundle bundle) { - if (analytics != null) { - analytics.logEvent(name, bundle); - } } public static void logError(String message, String exceptionName) { diff --git a/app/src/main/java/io/lbry/browser/utils/Lbryio.java b/app/src/main/java/io/lbry/browser/utils/Lbryio.java index 3beb53ae..cefb5356 100644 --- a/app/src/main/java/io/lbry/browser/utils/Lbryio.java +++ b/app/src/main/java/io/lbry/browser/utils/Lbryio.java @@ -228,12 +228,6 @@ public final class Lbryio { } Map options = new HashMap<>(); - if (context instanceof MainActivity) { - String firebaseToken = ((MainActivity) context).getFirebaseMessagingToken(); - if (!Helper.isNullOrEmpty(firebaseToken)) { - options.put("firebase_token", firebaseToken); - } - } options.put("app_version", appVersion); options.put("app_id", Lbry.INSTALLATION_ID); options.put("node_id", "");