endCall() function dosen't work
<p>My Manifest.xml：</p>

<pre><code>&lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
&lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
</code></pre>

<p>I could capture all the income call number and saved it in the my database. But in some mobiles, the function endCall() dosen't work. The bell still rang.  How can i solve this problem? thx.  </p>

<pre><code>public class CallReceiver extends BroadcastReceiver {

    public static final String TEST_NUMBER = "62419770";

    private static final String ACTION = "android.intent.action.PHONE_STATE";

    private ITelephony iTelephony;
    private AudioManager mAudioManager;

    public void onReceive(Context context, Intent intent) {
        mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
        TelephonyManager telephonyMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

        try {
            Method getITelephonyMethod = TelephonyManager.class.getDeclaredMethod("getITelephony", (Class[]) null);
            getITelephonyMethod.setAccessible(true);
            iTelephony = (ITelephony) getITelephonyMethod.invoke(telephonyMgr,(Object[]) null);
        }
        catch (Exception e) {
            e.printStackTrace();
        }

        String action = intent.getAction();

        if (ACTION.equals(action)) {
            String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
            String number = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER);
            if (state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING)) {
                 if(NameListData.hasCallName(number,DataBase.NameRecord.TYPE_BLACK))
                 {
                    mAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
                    try {
                        iTelephony.endCall();
                        mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
                        NotificationUtils.showSingleNotification(context,
                                context.getString(R.string.notification_intercept_phone_title),
                                number, InterceptListActivity.class,NotificationUtils.mInterceptrCallNotificationId);    
                        HarassCallUtils.addHarassCall(context, new CallItem(0, number, new Date().getTime(), 0 ,false));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }                    
                }
            }
        }
    }
}
</code></pre>
