I´m testing using MUTE so I can mute any channel and back also.
PH.SetMute ( PH.VOLUME_MUSIC, True )
PH.SetMute ( PH.VOLUME_RING, True )
Sr.StartListening(Starter.gLang,False,False)
This way I don´t need to save the volume value of any channel I just set mute off
With music, and whastapp call works OK when I detect Ihen I UNMUTE and the sound is OK.
But When I receive a call, I UNMUTE but still not ringing just vibrate.
It seems that when start ringing changing the mute to off doesn´t affect.
How to do it?
Sub PE1_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
' PhoneStateChanged - The phone State has changed.
' State - One of the three values: IDLE, OFFHOOK, RINGING. OFFHOOK means that there Is a call Or that the phone Is dialing.
' IncomingCall - Available when the State value Is RINGING.
Log ( "State Phone Change: " & State )
Select State
Case "IDLE"
' Timerx.Enabled = True
gStatusTelefone = "IDLE"
Case "OFFHOOK"
Log ( "Desligado Listen")
gStatusTelefone = "OFFHOOK"
Sr.StopListening
PH.SetMute ( PH.VOLUME_MUSIC, False )
PH.SetMute ( PH.VOLUME_RING, False )
Case "RINGING"
Log ( "Tocando Linha ......")
gStatusTelefone = "RINGING"
Sr.StopListening
PH.SetMute ( PH.VOLUME_MUSIC, False )
PH.SetMute ( PH.VOLUME_RING, False )
End Select
End Sub