Fixed call transfer and call add if auto start call setting is enabled
This commit is contained in:
parent
f6df9711b7
commit
7b581ba586
5 changed files with 10 additions and 4 deletions
|
@ -79,10 +79,11 @@ class DetailContactFragment : Fragment() {
|
|||
viewModel.startCallToEvent.observe(viewLifecycleOwner, Observer {
|
||||
it.consume { address ->
|
||||
if (coreContext.core.callsNb > 0) {
|
||||
Log.i("[Contact] Starting dialer with pre-filled URI ${address.asStringUriOnly()}")
|
||||
Log.i("[Contact] Starting dialer with pre-filled URI ${address.asStringUriOnly()}, is transfer? ${sharedViewModel.pendingCallTransfer}")
|
||||
val args = Bundle()
|
||||
args.putString("URI", address.asStringUriOnly())
|
||||
args.putBoolean("Transfer", sharedViewModel.pendingCallTransfer)
|
||||
args.putBoolean("SkipAutoCallStart", true) // If auto start call setting is enabled, ignore it
|
||||
findNavController().navigate(
|
||||
R.id.action_global_dialerFragment,
|
||||
args
|
||||
|
|
|
@ -89,11 +89,13 @@ class DialerFragment : Fragment() {
|
|||
|
||||
if (arguments?.containsKey("Transfer") == true) {
|
||||
sharedViewModel.pendingCallTransfer = arguments?.getBoolean("Transfer") ?: false
|
||||
Log.i("[Dialer] Is pending call transfer: ${sharedViewModel.pendingCallTransfer}")
|
||||
}
|
||||
if (arguments?.containsKey("URI") == true) {
|
||||
val address = arguments?.getString("URI") ?: ""
|
||||
val skipAutoCall = arguments?.getBoolean("SkipAutoCallStart") ?: false
|
||||
|
||||
if (corePreferences.callRightAway) {
|
||||
if (corePreferences.callRightAway && !skipAutoCall) {
|
||||
Log.i("[Dialer] Call right away setting is enabled, start the call to $address")
|
||||
viewModel.directCall(address)
|
||||
} else {
|
||||
|
|
|
@ -100,10 +100,11 @@ class DetailCallLogFragment : Fragment() {
|
|||
viewModel.startCallEvent.observe(viewLifecycleOwner, Observer {
|
||||
it.consume { address ->
|
||||
if (coreContext.core.callsNb > 0) {
|
||||
Log.i("[History] Starting dialer with pre-filled URI ${address.asStringUriOnly()}")
|
||||
Log.i("[History] Starting dialer with pre-filled URI ${address.asStringUriOnly()}, is transfer? ${sharedViewModel.pendingCallTransfer}")
|
||||
val args = Bundle()
|
||||
args.putString("URI", address.asStringUriOnly())
|
||||
args.putBoolean("Transfer", sharedViewModel.pendingCallTransfer)
|
||||
args.putBoolean("SkipAutoCallStart", true) // If auto start call setting is enabled, ignore it
|
||||
findNavController().navigate(
|
||||
R.id.action_global_dialerFragment,
|
||||
args
|
||||
|
|
|
@ -139,10 +139,11 @@ class MasterCallLogsFragment : MasterFragment() {
|
|||
adapter.startCallToEvent.observe(viewLifecycleOwner, Observer {
|
||||
it.consume { address ->
|
||||
if (coreContext.core.callsNb > 0) {
|
||||
Log.i("[History] Starting dialer with pre-filled URI ${address.asStringUriOnly()}")
|
||||
Log.i("[History] Starting dialer with pre-filled URI ${address.asStringUriOnly()}, is transfer? ${sharedViewModel.pendingCallTransfer}")
|
||||
val args = Bundle()
|
||||
args.putString("URI", address.asStringUriOnly())
|
||||
args.putBoolean("Transfer", sharedViewModel.pendingCallTransfer)
|
||||
args.putBoolean("SkipAutoCallStart", true) // If auto start call setting is enabled, ignore it
|
||||
findNavController().navigate(
|
||||
R.id.action_global_dialerFragment,
|
||||
args
|
||||
|
|
|
@ -369,6 +369,7 @@ class NotificationsManager(private val context: Context) {
|
|||
.setContentIntent(pendingIntent)
|
||||
.setCategory(NotificationCompat.CATEGORY_CALL)
|
||||
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
||||
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
||||
.setWhen(System.currentTimeMillis())
|
||||
.setAutoCancel(false)
|
||||
.setShowWhen(true)
|
||||
|
|
Loading…
Reference in a new issue