i want to disconnect outgoing call in ICS.
My issue is first of all I am not getting the broadcast in IC` in Gingerbread it is working fine and blocking the calls but in ICS its not Broadcasting.
for BroadCast I created a service and in that I am getting BroadCast of PHONE_STATE
in ICS also but when i try to disconnect call I am getting error of
NO such method name 'getITelephony'
in ICS call is not disconnecting.
I am using following code to disconnect call using the BroadCast...
try{
TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
Class c = Class.forName(manager.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony telephony = (ITelephony)m.invoke(manager);
telephony.endCall();
} catch(Exception e){
Log.d("",e.getMessage());
}
PhonecallStateBroadcastReceiver.java
with packgename of package com.android.internal.telephony;
ITelephony.aidl
interface ITelephony
{
boolean endCall();
void answerRingingCall();
void silenceRinger();
}