Browse Source

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>
Tim Krüger 2 years ago
parent
commit
5b5db208ee

+ 3 - 1
app/src/gplay/AndroidManifest.xml

@@ -2,6 +2,8 @@
   ~ Nextcloud Talk application
   ~
   ~ @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>
   ~
   ~ 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" />
 
         <service
-            android:name=".services.firebase.MagicFirebaseMessagingService"
+            android:name=".services.firebase.ChatAndCallMessagingService"
             android:exported="false"
             android:foregroundServiceType="phoneCall">
             <intent-filter>

+ 4 - 4
app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt → app/src/gplay/java/com/nextcloud/talk/services/firebase/ChatAndCallMessagingService.kt

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