blocking Incoming call - Android
<p>i have incoming call broadcast receiver and phone state listener class  , how to block or reject incoming call and the ringing notification  </p>

<p><strong>BroadCastReceiver</strong> </p>

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

    private static final String TAG = "Phone call";

    @Override
    public void onReceive(Context context, Intent intent) {
            Log.v(TAG, "Receving....");
            TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
            SamplePhoneStateListener customPhoneListener = new SamplePhoneStateListener();
            telephony.listen(customPhoneListener, PhoneStateListener.LISTEN_CALL_STATE);            

    }
}
</code></pre>

<p>Phone Listener</p>

<pre><code>public class SamplePhoneStateListener extends PhoneStateListener {

    private static final String TAG = "Phone Listner";

@Override
public void onCallStateChanged(int state, String incomingNumber) {
      Log.v(TAG, "Current State is - "+state);
      Log.v(TAG, incomingNumber);
      switch(state){
              case TelephonyManager.CALL_STATE_RINGING:
                      Log.d(TAG, "Phone Ringigg");
                      break;
      }    
     super.onCallStateChanged(state, incomingNumber);
}


}
</code></pre>
