Fix encryption icon

This commit is contained in:
Sylvain Berfini 2012-09-03 11:25:43 +02:00
parent 56b23e3c20
commit 57141d63ad
2 changed files with 22 additions and 6 deletions

View file

@ -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);
}
});
}
}

View file

@ -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);