Skip to content
Snippets Groups Projects
Commit 0ba9cfd7 authored by Amirhossein Naghshzan's avatar Amirhossein Naghshzan Committed by Adrien Béraud
Browse files

cleanup

Change-Id: Ie9325db0edfae05fe1472e10937e8417278df7cd
parent e5bc08a4
Branches
No related tags found
No related merge requests found
......@@ -43,8 +43,7 @@ import cx.ring.application.JamiApplication
import cx.ring.client.CallActivity
import cx.ring.client.ConversationActivity
import cx.ring.tv.call.TVCallActivity
import cx.ring.utils.ConversationPath.Companion.fromIntent
import cx.ring.utils.ConversationPath.Companion.fromUri
import cx.ring.utils.ConversationPath
import cx.ring.utils.DeviceUtils.isTv
import dagger.hilt.android.AndroidEntryPoint
import io.reactivex.rxjava3.disposables.CompositeDisposable
......@@ -215,7 +214,7 @@ class DRingService : Service() {
Log.w(TAG, "handleFileAction $extras")
val messageId = extras.getString(KEY_MESSAGE_ID)
val id = extras.getString(KEY_TRANSFER_ID)!!
val path = fromUri(uri)!!
val path = ConversationPath.fromUri(uri)!!
if (action == ACTION_FILE_ACCEPT) {
mNotificationService.removeTransferNotification(path.accountId, path.conversationUri, id)
mAccountService.acceptFileTransfer(path.accountId, path.conversationUri, messageId, id)
......@@ -225,7 +224,7 @@ class DRingService : Service() {
}
private fun handleTrustRequestAction(uri: Uri?, action: String) {
fromUri(uri)?.let { path ->
ConversationPath.fromUri(uri)?.let { path ->
mNotificationService.cancelTrustRequestNotification(path.accountId)
when (action) {
ACTION_TRUST_REQUEST_ACCEPT -> mConversationFacade.acceptRequest(path.accountId, path.conversationUri)
......@@ -299,7 +298,7 @@ class DRingService : Service() {
}
private fun handleConvAction(intent: Intent, action: String) {
val path = fromIntent(intent)
val path = ConversationPath.fromIntent(intent)
if (path == null || path.conversationId.isEmpty()) {
return
}
......
......@@ -90,12 +90,10 @@ class NotificationServiceImpl(
* @param callId the call ID
*/
private fun startCallActivity(callId: String) {
mContext.startActivity(
Intent(Intent.ACTION_VIEW)
mContext.startActivity(Intent(Intent.ACTION_VIEW)
.putExtra(NotificationService.KEY_CALL_ID, callId)
.setClass(mContext.applicationContext, TVCallActivity::class.java)
.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
)
.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NEW_TASK))
}
private fun buildCallNotification(conference: Conference): Notification? {
......
......@@ -451,6 +451,7 @@ class CallPresenter @Inject constructor(
view.handleCallWakelock(isAudioOnly)
if (scall.isIncoming) {
if (mAccountService.getAccount(scall.account!!)!!.isAutoanswerEnabled) {
Log.w(TAG, "Accept because of autoanswer")
mCallService.accept(scall.daemonIdString!!)
// only display the incoming call screen if the notification is a full screen intent
} else if (incomingIsFullIntent) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment