correcting the scheme at outgoing calls

This commit is contained in:
tibbi 2018-11-28 11:37:30 +01:00
parent 63bd1e65dd
commit 568254cede
2 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import android.os.Bundle
import android.os.Handler
import android.os.PowerManager
import android.telecom.Call
import android.telecom.PhoneAccount
import android.telecom.TelecomManager
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.simplemobiletools.commons.extensions.*
@ -138,7 +139,7 @@ class DialerActivity : SimpleActivity(), SensorEventListener {
private fun initOutgoingCall() {
val telecomManager = getSystemService(Context.TELECOM_SERVICE) as TelecomManager
val uri = Uri.fromParts("tel:", callNumber, null)
val uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, callNumber, null)
val extras = Bundle()
telecomManager.placeCall(uri, extras)
}

View File

@ -14,6 +14,7 @@ import android.widget.RemoteViews
import androidx.core.app.NotificationCompat
import com.simplemobiletools.commons.extensions.getColoredBitmap
import com.simplemobiletools.commons.extensions.setText
import com.simplemobiletools.commons.extensions.setVisibleIf
import com.simplemobiletools.commons.helpers.isOreoPlus
import com.simplemobiletools.contacts.pro.R
import com.simplemobiletools.contacts.pro.activities.DialerActivity
@ -40,7 +41,7 @@ class DialerCallService : Service() {
CallManager.declineCall()
stopForeground(true)
stopSelf()
} else {
} else if (intent.getBooleanExtra(IS_INCOMING_CALL, false)) {
callNumber = intent.getStringExtra(CALL_NUMBER)
callStatus = intent.getIntExtra(CALL_STATUS, Call.STATE_NEW)
isIncomingCall = intent.getBooleanExtra(IS_INCOMING_CALL, false)