From 359b2150eb8287dce6861a04fd6b8f8eeb620ec4 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 6 May 2024 13:26:16 +0200 Subject: [PATCH] move PushMessageReceiver to receiver package --- src/playstore/AndroidManifest.xml | 2 +- .../{services => receiver}/PushMessageReceiver.java | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) rename src/playstore/java/eu/siacs/conversations/{services => receiver}/PushMessageReceiver.java (74%) diff --git a/src/playstore/AndroidManifest.xml b/src/playstore/AndroidManifest.xml index 2f339c96f..e64f7e40b 100644 --- a/src/playstore/AndroidManifest.xml +++ b/src/playstore/AndroidManifest.xml @@ -24,7 +24,7 @@ diff --git a/src/playstore/java/eu/siacs/conversations/services/PushMessageReceiver.java b/src/playstore/java/eu/siacs/conversations/receiver/PushMessageReceiver.java similarity index 74% rename from src/playstore/java/eu/siacs/conversations/services/PushMessageReceiver.java rename to src/playstore/java/eu/siacs/conversations/receiver/PushMessageReceiver.java index f060747a5..40812c10d 100644 --- a/src/playstore/java/eu/siacs/conversations/services/PushMessageReceiver.java +++ b/src/playstore/java/eu/siacs/conversations/receiver/PushMessageReceiver.java @@ -1,21 +1,24 @@ -package eu.siacs.conversations.services; +package eu.siacs.conversations.receiver; import android.content.Intent; import android.util.Log; +import androidx.annotation.NonNull; + import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; import java.util.Map; import eu.siacs.conversations.Config; +import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.utils.Compatibility; public class PushMessageReceiver extends FirebaseMessagingService { @Override - public void onMessageReceived(RemoteMessage message) { - if (!EventReceiver.hasEnabledAccounts(this)) { + public void onMessageReceived(@NonNull final RemoteMessage message) { + if (!SystemEventReceiver.hasEnabledAccounts(this)) { Log.d(Config.LOGTAG,"PushMessageReceiver ignored message because no accounts are enabled"); return; } @@ -27,8 +30,8 @@ public class PushMessageReceiver extends FirebaseMessagingService { } @Override - public void onNewToken(String token) { - if (!EventReceiver.hasEnabledAccounts(this)) { + public void onNewToken(@NonNull final String token) { + if (!SystemEventReceiver.hasEnabledAccounts(this)) { Log.d(Config.LOGTAG,"PushMessageReceiver ignored new token because no accounts are enabled"); return; }