mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-14 08:15:04 +01:00
Reword incoming call extra & cleanup
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
bd1d5d0dbc
commit
1adf9e6cff
@ -50,7 +50,7 @@ import com.nextcloud.talk.utils.NotificationUtils.cancelAllNotificationsForAccou
|
|||||||
import com.nextcloud.talk.utils.NotificationUtils.cancelExistingNotificationWithId
|
import com.nextcloud.talk.utils.NotificationUtils.cancelExistingNotificationWithId
|
||||||
import com.nextcloud.talk.utils.PushUtils
|
import com.nextcloud.talk.utils.PushUtils
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_FROM_NOTIFICATION_START_CALL
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_OPEN_INCOMING_CALL
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_USER_ENTITY
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_USER_ENTITY
|
||||||
import com.nextcloud.talk.utils.preferences.AppPreferences
|
import com.nextcloud.talk.utils.preferences.AppPreferences
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
@ -125,10 +125,10 @@ class MagicFirebaseMessagingService : FirebaseMessagingService(), KoinComponent
|
|||||||
}
|
}
|
||||||
type == "call" -> {
|
type == "call" -> {
|
||||||
val fullScreenIntent = Intent(applicationContext, MagicCallActivity::class.java)
|
val fullScreenIntent = Intent(applicationContext, MagicCallActivity::class.java)
|
||||||
|
fullScreenIntent.action = KEY_OPEN_INCOMING_CALL
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putString(BundleKeys.KEY_ROOM_ID, decryptedPushMessage.id)
|
bundle.putString(BundleKeys.KEY_ROOM_ID, decryptedPushMessage.id)
|
||||||
bundle.putParcelable(KEY_USER_ENTITY, signatureVerification.userEntity)
|
bundle.putParcelable(KEY_USER_ENTITY, signatureVerification.userEntity)
|
||||||
bundle.putBoolean(KEY_FROM_NOTIFICATION_START_CALL, true)
|
|
||||||
fullScreenIntent.putExtras(bundle)
|
fullScreenIntent.putExtras(bundle)
|
||||||
|
|
||||||
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
|
||||||
|
@ -64,7 +64,7 @@ class MagicCallActivity : BaseActivity() {
|
|||||||
router!!.setPopsLastView(false)
|
router!!.setPopsLastView(false)
|
||||||
|
|
||||||
if (!router!!.hasRootController()) {
|
if (!router!!.hasRootController()) {
|
||||||
if (intent.getBooleanExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL, false)) {
|
if (intent.getBooleanExtra(BundleKeys.KEY_OPEN_INCOMING_CALL, false)) {
|
||||||
router!!.setRoot(
|
router!!.setRoot(
|
||||||
RouterTransaction.with(CallNotificationController(intent.extras!!))
|
RouterTransaction.with(CallNotificationController(intent.extras!!))
|
||||||
.pushChangeHandler(HorizontalChangeHandler())
|
.pushChangeHandler(HorizontalChangeHandler())
|
||||||
|
@ -154,8 +154,8 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {
|
} else if (intent.action == BundleKeys.KEY_OPEN_INCOMING_CALL) {
|
||||||
router!!.pushController(
|
router?.pushController(
|
||||||
RouterTransaction.with(CallNotificationController(intent.extras!!))
|
RouterTransaction.with(CallNotificationController(intent.extras!!))
|
||||||
.pushChangeHandler(HorizontalChangeHandler())
|
.pushChangeHandler(HorizontalChangeHandler())
|
||||||
.popChangeHandler(HorizontalChangeHandler())
|
.popChangeHandler(HorizontalChangeHandler())
|
||||||
|
@ -195,8 +195,8 @@ class ChatController(args: Bundle) : BaseController(), MessagesListAdapter
|
|||||||
credentials = ApiUtils.getCredentials(conversationUser?.username, conversationUser?.token)
|
credentials = ApiUtils.getCredentials(conversationUser?.username, conversationUser?.token)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.containsKey(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {
|
if (args.containsKey(BundleKeys.KEY_OPEN_INCOMING_CALL)) {
|
||||||
this.startCallFromNotification = args.getBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)
|
this.startCallFromNotification = args.getBoolean(BundleKeys.KEY_OPEN_INCOMING_CALL)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.voiceOnly = args.getBoolean(BundleKeys.KEY_CALL_VOICE_ONLY, false)
|
this.voiceOnly = args.getBoolean(BundleKeys.KEY_CALL_VOICE_ONLY, false)
|
||||||
|
@ -203,7 +203,6 @@ class MessageNotificationWorker(
|
|||||||
val pendingIntent: PendingIntent? = PendingIntent.getActivity(applicationContext,
|
val pendingIntent: PendingIntent? = PendingIntent.getActivity(applicationContext,
|
||||||
0, intent, 0)
|
0, intent, 0)
|
||||||
|
|
||||||
val userBaseUrl = Uri.parse(signatureVerification.userEntity!!.baseUrl).toString()
|
|
||||||
val soundUri = NotificationUtils.getMessageSoundUri(applicationContext, appPreferences)
|
val soundUri = NotificationUtils.getMessageSoundUri(applicationContext, appPreferences)
|
||||||
|
|
||||||
val audioAttributesBuilder: AudioAttributes.Builder =
|
val audioAttributesBuilder: AudioAttributes.Builder =
|
||||||
|
@ -43,8 +43,6 @@ object BundleKeys {
|
|||||||
val KEY_EXISTING_PARTICIPANTS = "KEY_EXISTING_PARTICIPANTS"
|
val KEY_EXISTING_PARTICIPANTS = "KEY_EXISTING_PARTICIPANTS"
|
||||||
val KEY_CALL_URL = "KEY_CALL_URL"
|
val KEY_CALL_URL = "KEY_CALL_URL"
|
||||||
val KEY_MODIFIED_BASE_URL = "KEY_MODIFIED_BASE_URL"
|
val KEY_MODIFIED_BASE_URL = "KEY_MODIFIED_BASE_URL"
|
||||||
val KEY_NOTIFICATION_SUBJECT = "KEY_NOTIFICATION_SUBJECT"
|
|
||||||
val KEY_NOTIFICATION_SIGNATURE = "KEY_NOTIFICATION_SIGNATURE"
|
|
||||||
val KEY_INTERNAL_USER_ID = "KEY_INTERNAL_USER_ID"
|
val KEY_INTERNAL_USER_ID = "KEY_INTERNAL_USER_ID"
|
||||||
val KEY_CONVERSATION_TYPE = "KEY_CONVERSATION_TYPE"
|
val KEY_CONVERSATION_TYPE = "KEY_CONVERSATION_TYPE"
|
||||||
val KEY_INVITED_PARTICIPANTS = "KEY_INVITED_PARTICIPANTS"
|
val KEY_INVITED_PARTICIPANTS = "KEY_INVITED_PARTICIPANTS"
|
||||||
@ -53,7 +51,7 @@ object BundleKeys {
|
|||||||
val KEY_CALL_VOICE_ONLY = "KEY_CALL_VOICE_ONLY"
|
val KEY_CALL_VOICE_ONLY = "KEY_CALL_VOICE_ONLY"
|
||||||
val KEY_ACTIVE_CONVERSATION = "KEY_ACTIVE_CONVERSATION"
|
val KEY_ACTIVE_CONVERSATION = "KEY_ACTIVE_CONVERSATION"
|
||||||
val KEY_SERVER_CAPABILITIES = "KEY_SERVER_CAPABILITIES"
|
val KEY_SERVER_CAPABILITIES = "KEY_SERVER_CAPABILITIES"
|
||||||
val KEY_FROM_NOTIFICATION_START_CALL = "KEY_FROM_NOTIFICATION_START_CALL"
|
val KEY_OPEN_INCOMING_CALL = "KEY_OPEN_INCOMING_CALL"
|
||||||
val KEY_ROOM_ID = "KEY_ROOM_ID"
|
val KEY_ROOM_ID = "KEY_ROOM_ID"
|
||||||
val KEY_ARE_CALL_SOUNDS = "KEY_ARE_CALL_SOUNDS"
|
val KEY_ARE_CALL_SOUNDS = "KEY_ARE_CALL_SOUNDS"
|
||||||
val KEY_BROWSER_TYPE = "KEY_BROWSER_TYPE"
|
val KEY_BROWSER_TYPE = "KEY_BROWSER_TYPE"
|
||||||
|
Loading…
Reference in New Issue
Block a user