Remove automatic double hangup

This was introduced in order to prevent the infinite busy ringtone.
Unfortunately it does not fix our sdes issue.

Refs #41441
diff --git a/src/org/sflphone/client/CallActivity.java b/src/org/sflphone/client/CallActivity.java
index e0dc4b2..12188f7 100644
--- a/src/org/sflphone/client/CallActivity.java
+++ b/src/org/sflphone/client/CallActivity.java
@@ -268,12 +268,12 @@
 
             @Override
             public void run() {
-                try {
+                /*try {
                     // We hang it up again to avoid infinite failure tone
                     mService.hangUp(mDisplayedConference.getId());
                 } catch (RemoteException e) {
                     e.printStackTrace();
-                }
+                }*/
                 finish();
             }
         };
diff --git a/src/org/sflphone/fragments/CallFragment.java b/src/org/sflphone/fragments/CallFragment.java
index 28b9618..8e9c511 100644
--- a/src/org/sflphone/fragments/CallFragment.java
+++ b/src/org/sflphone/fragments/CallFragment.java
@@ -443,7 +443,6 @@
     private void showLock(int resId) {
         ImageView lock = (ImageView) mSecuritySwitch.findViewById(R.id.lock_image);
         lock.setImageDrawable(getResources().getDrawable(resId));
-        Log.i(TAG, "mSecuritySwitch.getDisplayedChild(): " + mSecuritySwitch.getDisplayedChild());
         mSecuritySwitch.setDisplayedChild(1);
         mSecuritySwitch.setVisibility(View.VISIBLE);
     }
diff --git a/src/org/sflphone/service/CallManagerCallBack.java b/src/org/sflphone/service/CallManagerCallBack.java
index cc14c2f..7249888 100644
--- a/src/org/sflphone/service/CallManagerCallBack.java
+++ b/src/org/sflphone/service/CallManagerCallBack.java
@@ -67,8 +67,6 @@
                 toUpdate.setCallState(callID, SipCall.state.CALL_STATE_HUNGUP);
                 mService.mHistoryManager.insertNewEntry(toUpdate);
                 mService.getConferences().remove(toUpdate.getId());
-                Log.e(TAG, "Conferences :" + mService.getConferences().size());
-                Log.e(TAG, "toUpdate.getParticipants() :" + toUpdate.getParticipants().size());
             } else {
                 toUpdate.setCallState(callID, SipCall.state.CALL_STATE_HUNGUP);
                 mService.mHistoryManager.insertNewEntry(call);
@@ -79,6 +77,7 @@
         } else if (newState.equals("FAILURE")) {
             toUpdate.setCallState(callID, SipCall.state.CALL_STATE_FAILURE);
             mService.getConferences().remove(toUpdate.getId());
+            mService.getCallManagerJNI().hangUp(callID);
         } else if (newState.equals("HOLD")) {
             toUpdate.setCallState(callID, SipCall.state.CALL_STATE_HOLD);
         } else if (newState.equals("UNHOLD")) {
@@ -115,11 +114,7 @@
 
             Conference toAdd;
             if (acc.useSecureLayer()) {
-                Bundle secureArgs = new Bundle();
-                secureArgs.putBoolean(SecureSipCall.DISPLAY_SAS, acc.getSrtpDetails().getDetailBoolean(AccountDetailSrtp.CONFIG_ZRTP_DISPLAY_SAS));
-                secureArgs.putBoolean(SecureSipCall.DISPLAY_SAS_ONCE, acc.getSrtpDetails().getDetailBoolean(AccountDetailSrtp.CONFIG_ZRTP_DISPLAY_SAS_ONCE));
-                secureArgs.putBoolean(SecureSipCall.DISPLAY_WARNING_ZRTP_NOT_SUPPORTED, newCall.getAccount().getSrtpDetails().getDetailBoolean(AccountDetailSrtp.CONFIG_ZRTP_NOT_SUPP_WARNING));
-                SecureSipCall secureCall = new SecureSipCall(newCall, secureArgs);
+               SecureSipCall secureCall = new SecureSipCall(newCall);
                 toAdd = new Conference(secureCall);
             } else {
                 toAdd = new Conference(newCall);
@@ -296,6 +291,10 @@
         Intent intent = new Intent(ZRTP_OFF);
         intent.putExtra("callID", callID);
         SecureSipCall call = (SecureSipCall) mService.getCallById(callID);
+        // Security can be off because call was hung up
+        if (call == null)
+            return;
+
         call.setInitialized();
         call.setZrtpSupport(false);
         intent.putExtra("conference", mService.findConference(callID));
diff --git a/src/org/sflphone/service/SipService.java b/src/org/sflphone/service/SipService.java
index ad45073..125284f 100644
--- a/src/org/sflphone/service/SipService.java
+++ b/src/org/sflphone/service/SipService.java
@@ -360,11 +360,7 @@
                     Log.i(TAG, "SipService.placeCall() thread running...");
                     Conference toAdd;
                     if(call.getAccount().useSecureLayer()){
-                        Bundle secureArgs = new Bundle();
-                        secureArgs.putBoolean(SecureSipCall.DISPLAY_SAS, call.getAccount().getSrtpDetails().getDetailBoolean(AccountDetailSrtp.CONFIG_ZRTP_DISPLAY_SAS));
-                        secureArgs.putBoolean(SecureSipCall.DISPLAY_SAS_ONCE, call.getAccount().getSrtpDetails().getDetailBoolean(AccountDetailSrtp.CONFIG_ZRTP_DISPLAY_SAS_ONCE));
-                        secureArgs.putBoolean(SecureSipCall.DISPLAY_WARNING_ZRTP_NOT_SUPPORTED, call.getAccount().getSrtpDetails().getDetailBoolean(AccountDetailSrtp.CONFIG_ZRTP_NOT_SUPP_WARNING));
-                        SecureSipCall secureCall = new SecureSipCall(call, secureArgs);
+                        SecureSipCall secureCall = new SecureSipCall(call);
                         toAdd = new Conference(secureCall);
                     } else {
                         toAdd = new Conference(call);
@@ -404,13 +400,13 @@
         @Override
         public void hangUp(final String callID) {
             mMediaManager.stopRing();
+            Log.e(TAG, "HANGING UP");
             getExecutor().execute(new SipRunnable() {
                 @Override
                 protected void doRun() throws SameThreadException {
                     Log.i(TAG, "SipService.hangUp() thread running...");
                     callManagerJNI.hangUp(callID);
                     removeCall(callID);
-                    Log.i(TAG, "mConferences.size():"+mConferences.size());
                     if(mConferences.size() == 0) {
                         Log.i(TAG, "No more calls!");
                         mMediaManager.abandonAudioFocus();
@@ -777,6 +773,7 @@
 
         @Override
         public void hangUpConference(final String confID) throws RemoteException {
+            Log.e(TAG, "HANGING UP CONF");
             getExecutor().execute(new SipRunnable() {
                 @Override
                 protected void doRun() throws SameThreadException, RemoteException {