I'm not able to access the showCallScreenWithDialpad
method of the com.android.internal.telephony.ITelephony.AIDL
class. I've already tried reflection
and I could not. You can not instantiate the class ITelephony$Stub
. I also tried for bindService
and also could not ( bindService
returns false
). Can anyone help?
What I want to do is to hide the Android calling screen, ie make a phone call and the default call screen does not appear.
Below is what I've tried.
By reflection:
.
.
.
classCallManager = classLoader.loadClass("com.android.internal.telephony.ITelephony$Stub");
getITelephonyMethod = classCallManager.getMethod("onTransact", cArg);
objeto = classCallManager.newInstance();
getITelephonyMethod.invoke(objeto, 1, "1234567", "1234567", 1);
This gives an error:
Caused by: java.lang.NullPointerException: null receiver
Because the object variable is equal to null
, because the class can not be instantiated:
W / System.err: java.lang.InstantiationException: class com.android.internal.telephony.ITelephony $ Stub can not be instantiated
Now for bindService:
.
.
.
final ServiceConnection conexao = this;
Class classeServico2 = ITelephony.class;
boolean resultado = bindService(new Intent(MainActivity.this, classeServico2), conexao, Context.BIND_AUTO_CREATE);
And bindService
returns false
.