title: how to disconnect the call in android 4.1.2 nexus programmatically
body: <p>i am able to disconnect the call programmatically for incoming unknown number call in android 2.2. But in android 4.1, its not working. </p>
  
  <p><strong>Working Code to disconnect the call in android 2.2:</strong></p>
  
  <pre><code>private Class c;    
  private  Method m;    
  private com.android.internal.telephony.ITelephony telephonyService;    
  public void onReceive(Context context, Intent intent)     
  {    
     Bundle b = intent.getExtras();    
     String state = b.getString(TelephonyManager.EXTRA_STATE);    
     if(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING))   
     {    
       TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);    
       c = Class.forName(tm.getClass().getName());    
       m = c.getDeclaredMethod("getITelephony");    
       m.setAccessible(true);    
       telephonyService = (ITelephony) m.invoke(tm);    
       telephonyService.silenceRinger();   
       telephonyService.endCall();    
     }    
  }
  </code></pre>
  
  <p>Please help me.Thanks in advance</p>
  
  <p><strong>Finally I got a solution for 2.6 version .</strong></p>
  
  <p><code>MODIFY_PHONE_STATE</code> permission is no longer working on silenceRinger() since 2.3+, but endCall is just fine. So the solution is to comment out the call to silenceRinger().</p>