move PushMessageReceiver to receiver package
This commit is contained in:
parent
730f087a86
commit
359b2150eb
|
@ -24,7 +24,7 @@
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".services.PushMessageReceiver"
|
android:name=".receiver.PushMessageReceiver"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||||
|
|
|
@ -1,21 +1,24 @@
|
||||||
package eu.siacs.conversations.services;
|
package eu.siacs.conversations.receiver;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.firebase.messaging.FirebaseMessagingService;
|
import com.google.firebase.messaging.FirebaseMessagingService;
|
||||||
import com.google.firebase.messaging.RemoteMessage;
|
import com.google.firebase.messaging.RemoteMessage;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import eu.siacs.conversations.Config;
|
import eu.siacs.conversations.Config;
|
||||||
|
import eu.siacs.conversations.services.XmppConnectionService;
|
||||||
import eu.siacs.conversations.utils.Compatibility;
|
import eu.siacs.conversations.utils.Compatibility;
|
||||||
|
|
||||||
public class PushMessageReceiver extends FirebaseMessagingService {
|
public class PushMessageReceiver extends FirebaseMessagingService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessageReceived(RemoteMessage message) {
|
public void onMessageReceived(@NonNull final RemoteMessage message) {
|
||||||
if (!EventReceiver.hasEnabledAccounts(this)) {
|
if (!SystemEventReceiver.hasEnabledAccounts(this)) {
|
||||||
Log.d(Config.LOGTAG,"PushMessageReceiver ignored message because no accounts are enabled");
|
Log.d(Config.LOGTAG,"PushMessageReceiver ignored message because no accounts are enabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -27,8 +30,8 @@ public class PushMessageReceiver extends FirebaseMessagingService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNewToken(String token) {
|
public void onNewToken(@NonNull final String token) {
|
||||||
if (!EventReceiver.hasEnabledAccounts(this)) {
|
if (!SystemEventReceiver.hasEnabledAccounts(this)) {
|
||||||
Log.d(Config.LOGTAG,"PushMessageReceiver ignored new token because no accounts are enabled");
|
Log.d(Config.LOGTAG,"PushMessageReceiver ignored new token because no accounts are enabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
Loading…
Reference in a new issue