Hi,
This routine is work perfectly before Android 8.x. The MODIFY_PHONE_STATE permission already put into manifest editor. Would you help me to solve this problem ? Thanks !
This is error message on Android 8.x .
This routine is work perfectly before Android 8.x. The MODIFY_PHONE_STATE permission already put into manifest editor. Would you help me to solve this problem ? Thanks !
B4X:
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")
This is error message on Android 8.x .
java.lang.SecurityException: MODIFY_PHONE_STATE permission required.
at android.os.Parcel.readException(Parcel.java:2005)
at android.os.Parcel.readException(Parcel.java:1951)
at com.android.internal.telephony.ITelephony$Stub$Proxy.endCall(ITelephony.java:2027)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:216)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
at com.hkcorp.b4a.qehkfilter.joblistener._killcallnow(joblistener.java:910)
at com.hkcorp.b4a.qehkfilter.joblistener._killcall(joblistener.java:882)
at com.hkcorp.b4a.qehkfilter.joblistener._handlecall(joblistener.java:709)
at com.hkcorp.b4a.qehkfilter.joblistener._pe_phonestatechanged(joblistener.java:1296)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.phone.PhoneEvents$ActionHandler.send(PhoneEvents.java:326)
at anywheresoftware.b4a.phone.PhoneEvents$15.handle(PhoneEvents.java:245)
at anywheresoftware.b4a.phone.PhoneEvents$16.onReceive(PhoneEvents.java:268)
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52497(LoadedApk.java:1313)
at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.$m$7(Unknown Source:4)
at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run(Unknown Source:39)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)