~singpolyma/cheogram-android

2b9862adea0e56f58474d5d9c9562fab46be57a3 — Daniel Gultsch 3 years ago d91cd3e
update some libraries
1 files changed, 4 insertions(+), 12 deletions(-)

M src/playstore/java/eu/siacs/conversations/services/MaintenanceReceiver.java
M src/playstore/java/eu/siacs/conversations/services/MaintenanceReceiver.java => src/playstore/java/eu/siacs/conversations/services/MaintenanceReceiver.java +4 -12
@@ 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();

		});
	}
}