fix: launch CallActivity when call is picked from notification

- add CallActivity.getStartIntent method to get the start intent for CallActivity and update in CallNotificationManager and CallService where the CallActivity is started
- in CallActionReceiver, start the CallActivity before answering the call
This commit is contained in:
darthpaul
2021-09-20 00:02:53 +01:00
parent dd6316ae81
commit bdab26838e
4 changed files with 16 additions and 7 deletions

View File

@ -3,6 +3,7 @@ package com.simplemobiletools.dialer.activities
import android.annotation.SuppressLint
import android.app.KeyguardManager
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.media.AudioManager
import android.os.Bundle
@ -29,6 +30,14 @@ import kotlinx.android.synthetic.main.activity_call.*
import kotlinx.android.synthetic.main.dialpad.*
class CallActivity : SimpleActivity() {
companion object {
fun getStartIntent(context: Context): Intent {
val openAppIntent = Intent(context, CallActivity::class.java)
openAppIntent.flags = Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT or Intent.FLAG_ACTIVITY_NEW_TASK
return openAppIntent
}
}
private var isSpeakerOn = false
private var isMicrophoneOn = true
private var isCallEnded = false