From 57141d63ad39964dfad4d05c99a58429636e205c Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 3 Sep 2012 11:25:43 +0200 Subject: [PATCH] Fix encryption icon --- src/org/linphone/InCallActivity.java | 20 +++++++++++++++++--- src/org/linphone/StatusFragment.java | 8 +++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/org/linphone/InCallActivity.java b/src/org/linphone/InCallActivity.java index 5de8a05c5..43d26646f 100644 --- a/src/org/linphone/InCallActivity.java +++ b/src/org/linphone/InCallActivity.java @@ -639,7 +639,7 @@ public class InCallActivity extends FragmentActivity implements } @Override - public void onCallStateChanged(LinphoneCall call, State state, String message) { + public void onCallStateChanged(final LinphoneCall call, State state, String message) { if (state==State.Error){ showToast(R.string.call_error, message); } @@ -658,6 +658,15 @@ public class InCallActivity extends FragmentActivity implements isMicMuted = LinphoneManager.getLc().isMicMuted(); enableAndRefreshInCallActions(); + + if (status != null) { + mHandler.post(new Runnable() { + @Override + public void run() { + status.refreshStatusItems(call); + } + }); + } } if (audioCallFragment != null) { @@ -682,9 +691,14 @@ public class InCallActivity extends FragmentActivity implements } @Override - public void onCallEncryptionChanged(LinphoneCall call, boolean encrypted, String authenticationToken) { + public void onCallEncryptionChanged(final LinphoneCall call, boolean encrypted, String authenticationToken) { if (status != null) { - status.refreshStatusItems(); + mHandler.post(new Runnable() { + @Override + public void run() { + status.refreshStatusItems(call); + } + }); } } diff --git a/src/org/linphone/StatusFragment.java b/src/org/linphone/StatusFragment.java index ab7db254e..b6878abf4 100644 --- a/src/org/linphone/StatusFragment.java +++ b/src/org/linphone/StatusFragment.java @@ -25,6 +25,7 @@ import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCore.MediaEncryption; import org.linphone.core.LinphoneCore.RegistrationState; import org.linphone.core.LinphoneProxyConfig; +import org.linphone.core.Log; import org.linphone.ui.SlidingDrawer; import org.linphone.ui.SlidingDrawer.OnDrawerOpenListener; @@ -265,8 +266,9 @@ public class StatusFragment extends Fragment { super.onResume(); if (isInCall) { + LinphoneCall call = LinphoneManager.getLc().getCurrentCall(); startCallQuality(); - refreshStatusItems(); + refreshStatusItems(call); // We are obviously connected statusLed.setImageResource(R.drawable.led_connected); @@ -294,10 +296,10 @@ public class StatusFragment extends Fragment { } } - public void refreshStatusItems() { - LinphoneCall call = LinphoneManager.getLc().getCurrentCall(); + public void refreshStatusItems(LinphoneCall call) { if (call != null && encryption != null) { MediaEncryption mediaEncryption = call.getCurrentParamsCopy().getMediaEncryption(); + Log.e("MediaEncryption = " + mediaEncryption); exit.setVisibility(View.GONE); statusText.setVisibility(View.GONE);