Fix bad status message on return from video call

This commit is contained in:
Guillaume Beraudo 2011-06-21 16:20:15 +02:00
parent cada9999f6
commit 79bf306a4f
3 changed files with 20 additions and 2 deletions

View file

@ -420,4 +420,18 @@ public class DialerActivity extends SoftVolumeActivity implements LinphoneGuiLis
}
}
@Override
protected void onResume() {
// When coming back from a video call, if the phone orientation is different
// Android will destroy the previous Dialer and create a new one.
// Unfortunately the "call end" status event is received in the meanwhile
// and set to the to be destroyed Dialer.
// Note1: We wait as long as possible before setting the last message.
// Note2: Linphone service is in charge of instantiating LinphoneManager
if (LinphoneService.isReady()) {
mStatus.setText(LinphoneManager.getInstance().getLastLcStatusMessage());
}
super.onResume();
}
}

View file

@ -111,6 +111,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
private LinphoneCore mLc;
private static Transports initialTransports;
private static LinphonePreferenceManager lpm;
private String lastLcStatusMessage;
@ -626,9 +627,12 @@ public final class LinphoneManager implements LinphoneCoreListener {
LinphoneAddress from, String message) {}
public String getLastLcStatusMessage() {
return lastLcStatusMessage;
}
public void displayStatus(final LinphoneCore lc, final String message) {
Log.i(message);
lastLcStatusMessage=message;
serviceListener.onDisplayStatus(message);
}

@ -1 +1 @@
Subproject commit 338884fa4d64a59e30697de8fc68b1e84b7ca504
Subproject commit 928e9717531c342ec38b00a66dd7fe1f77fd8909