Rename 'MagicFirebaseMessagingService'

Renamed the service to 'ChatAndCallMessagingService' to respect that the
service handles chat messages and calls.

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2022-06-23 10:00:21 +02:00
parent 331309405d
commit 5b5db208ee
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E
2 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,8 @@
~ Nextcloud Talk application ~ Nextcloud Talk application
~ ~
~ @author Mario Danic ~ @author Mario Danic
~ @author Tim Krüger
~ Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
~ Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com> ~ Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
~ ~
~ This program is free software: you can redistribute it and/or modify ~ This program is free software: you can redistribute it and/or modify
@ -38,7 +40,7 @@
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" /> <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
<service <service
android:name=".services.firebase.MagicFirebaseMessagingService" android:name=".services.firebase.ChatAndCallMessagingService"
android:exported="false" android:exported="false"
android:foregroundServiceType="phoneCall"> android:foregroundServiceType="phoneCall">
<intent-filter> <intent-filter>

View File

@ -81,7 +81,7 @@ import javax.inject.Inject
@SuppressLint("LongLogTag") @SuppressLint("LongLogTag")
@AutoInjector(NextcloudTalkApplication::class) @AutoInjector(NextcloudTalkApplication::class)
class MagicFirebaseMessagingService : FirebaseMessagingService() { class ChatAndCallMessagingService : FirebaseMessagingService() {
@JvmField @JvmField
@Inject @Inject
var appPreferences: AppPreferences? = null var appPreferences: AppPreferences? = null
@ -215,7 +215,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
fullScreenIntent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NEW_TASK fullScreenIntent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NEW_TASK
val fullScreenPendingIntent = PendingIntent.getActivity( val fullScreenPendingIntent = PendingIntent.getActivity(
this@MagicFirebaseMessagingService, this@ChatAndCallMessagingService,
0, 0,
fullScreenIntent, fullScreenIntent,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
@ -231,7 +231,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
val baseUrl = uri.host val baseUrl = uri.host
val notification = val notification =
NotificationCompat.Builder(this@MagicFirebaseMessagingService, notificationChannelId) NotificationCompat.Builder(this@ChatAndCallMessagingService, notificationChannelId)
.setPriority(NotificationCompat.PRIORITY_HIGH) .setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_CALL) .setCategory(NotificationCompat.CATEGORY_CALL)
.setSmallIcon(R.drawable.ic_call_black_24dp) .setSmallIcon(R.drawable.ic_call_black_24dp)
@ -333,7 +333,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
} }
companion object { companion object {
const val TAG = "MagicFirebaseMessagingService" private val TAG = ChatAndCallMessagingService::class.simpleName
private const val OBSERVABLE_COUNT = 12 private const val OBSERVABLE_COUNT = 12
private const val OBSERVABLE_DELAY: Long = 5 private const val OBSERVABLE_DELAY: Long = 5
} }