From 2b9862adea0e56f58474d5d9c9562fab46be57a3 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 13 May 2021 10:27:05 +0200 Subject: [PATCH] update some libraries --- .../services/MaintenanceReceiver.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/playstore/java/eu/siacs/conversations/services/MaintenanceReceiver.java b/src/playstore/java/eu/siacs/conversations/services/MaintenanceReceiver.java index 24212cf34..2a08cf676 100644 --- a/src/playstore/java/eu/siacs/conversations/services/MaintenanceReceiver.java +++ b/src/playstore/java/eu/siacs/conversations/services/MaintenanceReceiver.java @@ -5,9 +5,7 @@ import android.content.Context; import android.content.Intent; import android.util.Log; -import com.google.firebase.iid.FirebaseInstanceId; - -import java.io.IOException; +import com.google.firebase.installations.FirebaseInstallations; import eu.siacs.conversations.Config; import eu.siacs.conversations.utils.Compatibility; @@ -23,16 +21,10 @@ public class MaintenanceReceiver extends BroadcastReceiver { } private void renewInstanceToken(final Context context) { - new Thread(() -> { - try { - FirebaseInstanceId.getInstance().deleteInstanceId(); - final Intent intent = new Intent(context, XmppConnectionService.class); + FirebaseInstallations.getInstance().delete().addOnSuccessListener(unused -> { + final Intent intent = new Intent(context, XmppConnectionService.class); intent.setAction(XmppConnectionService.ACTION_FCM_TOKEN_REFRESH); Compatibility.startService(context, intent); - } catch (IOException e) { - Log.d(Config.LOGTAG, "unable to renew instance token", e); - } - }).start(); - + }); } }