'Service module
Sub Process_Globals
Dim PE As PhoneEvents
Dim AP As AnswerPhone
Dim P As Phone
End Sub
Sub Service_Create
PE.InitializeWithPhoneState("PE",PhoneId)
Log("Service created")
End Sub
Sub Service_Start
Log("Service started.")
End Sub
Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
ToastMessageShow("PhoneStateChanged, State = " & State & ", IncomingNumber = " & IncomingNumber, True)
If State = "RINGING" Then
'State Silent Mode
P.SetRingerMode(P.RINGER_SILENT)
AP.answercall
ToastMessageShow("2 -- PhoneStateChanged, State = " & State & ", IncomingNumber = " & IncomingNumber, True)
End If
End Sub
Sub Service_Destroy
End Sub