title: Itelephony service end call () not working on Samsung GT-S7562 android version 4.0.4
body: <p>I am using <code>Itelephony</code> service to end the call programmatically. It’s working on HTC android version 4.1 but not working on <code>SAMSUNG GT-S7562</code> a<code>ndroid version 4.0.4</code> 
  Here is my code</p>
  
  <pre><code>TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
              System.out.println("telephonyManager..."+telephonyManager);
              Class clazz = null;
              try {
                  clazz = Class.forName(telephonyManager.getClass().getName());
                  System.out.println("clazz..."+clazz);
              } catch (ClassNotFoundException e1) {
                  // TODO Auto-generated catch block
                  e1.printStackTrace();
              }
              Method method = null;
              try 
              {
                  method = clazz.getDeclaredMethod("getITelephony");
                  System.out.println("method..."+method);
              } catch (NoSuchMethodException e1) {
                  // TODO Auto-generated catch block
                  e1.printStackTrace();
              }
              method.setAccessible(true);
              ITelephony telephonyService = null;
              try 
              {
                  telephonyService = (ITelephony) method.invoke(telephonyManager);
              } catch (IllegalArgumentException e1) {
                  // TODO Auto-generated catch block
                  e1.printStackTrace();
              } catch (IllegalAccessException e1) {
                  // TODO Auto-generated catch block
                  e1.printStackTrace();
              } catch (InvocationTargetException e1) {
                  // TODO Auto-generated catch block
                  e1.printStackTrace();
              }
              try
              {
                  telephonyService.endCall();
                  Intent   intent = new Intent(OutGoingScreen.this, Dialpad.class);
                  startActivity(intent); 
              } catch (RemoteException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
          }
  </code></pre>
  
  <p><strong>My log at is showing this</strong></p>
  
  <pre><code>10-09 09:26:18.938: D/memalloc(4653): /dev/pmem: Mapped buffer base:0x51bf0000 size:9031680 offset:7495680 fd:68
  10-09 09:26:19.038: I/System.out(4653): telephonyManager...android.telephony.MSimTelephonyManager@41aefa58
  10-09 09:26:19.038: I/System.out(4653): clazz...class android.telephony.MSimTelephonyManager
  10-09 09:26:19.038: W/System.err(4653): java.lang.NoSuchMethodException: getITelephony []
  10-09 09:26:19.058: W/System.err(4653):     at java.lang.Class.getConstructorOrMethod(Class.java:460)
  10-09 09:26:19.058: W/System.err(4653):     at java.lang.Class.getDeclaredMethod(Class.java:685)
  10-09 09:26:19.058: W/System.err(4653):     at             com.example.demo.OutGoingScreen$1.onClick(OutGoingScreen.java:73)
  10-09 09:26:19.058: W/System.err(4653):     at android.view.View.performClick(View.java:3567)
  10-09 09:26:19.058: W/System.err(4653):     at android.view.View$PerformClick.run(View.java:14224)
  10-09 09:26:19.058: W/System.err(4653):     at android.os.Handler.handleCallback(Handler.java:605)
  10-09 09:26:19.058: W/System.err(4653):     at android.os.Handler.dispatchMessage(Handler.java:92)
  10-09 09:26:19.058: W/System.err(4653):     at android.os.Looper.loop(Looper.java:137)
  10-09 09:26:19.058: W/System.err(4653):     at android.app.ActivityThread.main(ActivityThread.java:4517)
  10-09 09:26:19.058: W/System.err(4653):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-09 09:26:19.068: W/System.err(4653):     at java.lang.reflect.Method.invoke(Method.java:511)
  10-09 09:26:19.068: W/System.err(4653):     at    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
  10-09 09:26:19.068: W/System.err(4653):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
  10-09 09:26:19.068: W/System.err(4653):     at dalvik.system.NativeStart.main(Native Method)
  10-09 09:26:19.068: D/AndroidRuntime(4653): Shutting down VM
  10-09 09:26:19.078: W/dalvikvm(4653): threadid=1: thread exiting with uncaught exception (group=0x40c06a68)
  10-09 09:26:19.088: E/AndroidRuntime(4653): java.lang.NullPointerException
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at com.example.demo.OutGoingScreen$1.onClick(OutGoingScreen.java:79)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at android.view.View.performClick(View.java:3567)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at android.view.View$PerformClick.run(View.java:14224)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at android.os.Handler.handleCallback(Handler.java:605)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at android.os.Handler.dispatchMessage(Handler.java:92)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at android.os.Looper.loop(Looper.java:137)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at android.app.ActivityThread.main(ActivityThread.java:4517)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at java.lang.reflect.Method.invoke(Method.java:511)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
  10-09 09:26:19.088: E/AndroidRuntime(4653):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p><strong>I have added this in manifest</strong></p>
  
  <pre><code> &lt;uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /&gt;
   &lt;uses-permission android:name="android.permission.MODIFY_PHONE_STATE" /&gt;
   &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt;
   &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
   &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
   &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
   &lt;uses-permission android:name="android.permission.READ_CALL_LOG" /&gt;
   &lt;uses-permission android:name="android.permission.WRITE_CONTACTS" /&gt;
  </code></pre>
  
  <p>my Itelephony.aidl file is</p>
  
  <pre><code>package com.android.internal.telephony;
  interface ITelephony {
  
  boolean endCall();
  
  void answerRingingCall();
  
  }
  </code></pre>