Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim PE As PhoneEvents
Dim PhoneId As PhoneId
End Sub
Sub Service_Create
PE.InitializeWithPhoneState("PE", PhoneId)
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Service_Destroy
End Sub
Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent1 As Intent)
If State="RINGING" Then
'Squillo
if IncomingNumber ="0039333xxxx" then KillCall
Else If State="OFFHOOK" Then
' OFF Hook
else If State="IDLE" Then
'IDEL
End If
End Sub
Sub KillCall
Dim r As Reflector
r.Target = r.GetContext
Dim TelephonyManager, TelephonyInterface As Object
TelephonyManager = r.RunMethod2("getSystemService", "phone", "java.lang.String")
r.Target = TelephonyManager
TelephonyInterface = r.RunMethod("getITelephony")
r.Target = TelephonyInterface
r.RunMethod("endCall")
End Sub