Fix crash in call stats view
This commit is contained in:
parent
f8d6499b2e
commit
9d7df73d9f
7 changed files with 41 additions and 35 deletions
|
@ -14,6 +14,7 @@
|
|||
android:text="@string/assistant_create_account"
|
||||
style="@style/font6"
|
||||
android:textAllCaps="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/title_account_activation" />
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
android:text="@string/assistant_create_account"
|
||||
style="@style/font6"
|
||||
android:textAllCaps="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
@ -21,7 +22,7 @@
|
|||
android:text="@string/assistant_validate_account_1"
|
||||
style="@style/font11"
|
||||
android:paddingTop="10dp"
|
||||
android:gravity="center"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.Timer;
|
|||
import java.util.TimerTask;
|
||||
|
||||
import org.linphone.assistant.AssistantActivity;
|
||||
import org.linphone.core.LinphoneAccountCreator;
|
||||
import org.linphone.core.LinphoneCall;
|
||||
import org.linphone.core.LinphoneCallParams;
|
||||
import org.linphone.core.LinphoneCallStats;
|
||||
|
@ -450,6 +451,7 @@ public class StatusFragment extends Fragment {
|
|||
, TextView ul, TextView ice, TextView ip, TextView senderLossRate
|
||||
, TextView receiverLossRate, TextView enc, TextView dec, TextView videoResolutionSent
|
||||
, TextView videoResolutionReceived, boolean isVideo) {
|
||||
Context ctxt = LinphoneActivity.instance();
|
||||
if (stats != null) {
|
||||
layout.setVisibility(View.VISIBLE);
|
||||
title.setVisibility(TextView.VISIBLE);
|
||||
|
@ -460,33 +462,33 @@ public class StatusFragment extends Fragment {
|
|||
LinphoneManager.getInstance().getOpenH264DownloadHelper().isCodecFound()) {
|
||||
mime = "OpenH264";
|
||||
}
|
||||
formatText(codec, getString(R.string.call_stats_codec),
|
||||
formatText(codec, ctxt.getString(R.string.call_stats_codec),
|
||||
mime + " / " + (media.getRate() / 1000) + "kHz");
|
||||
}
|
||||
formatText(enc, getString(R.string.call_stats_encoder_name),
|
||||
formatText(enc, ctxt.getString(R.string.call_stats_encoder_name),
|
||||
stats.getEncoderName(media));
|
||||
formatText(dec, getString(R.string.call_stats_decoder_name),
|
||||
formatText(dec, ctxt.getString(R.string.call_stats_decoder_name),
|
||||
stats.getDecoderName(media));
|
||||
formatText(dl, getString(R.string.call_stats_download),
|
||||
formatText(dl, ctxt.getString(R.string.call_stats_download),
|
||||
String.valueOf((int) stats.getDownloadBandwidth()) + " kbits/s");
|
||||
formatText(ul, getString(R.string.call_stats_upload),
|
||||
formatText(ul, ctxt.getString(R.string.call_stats_upload),
|
||||
String.valueOf((int) stats.getUploadBandwidth()) + " kbits/s");
|
||||
formatText(ice, getString(R.string.call_stats_ice),
|
||||
formatText(ice, ctxt.getString(R.string.call_stats_ice),
|
||||
stats.getIceState().toString());
|
||||
formatText(ip, getString(R.string.call_stats_ip),
|
||||
formatText(ip, ctxt.getString(R.string.call_stats_ip),
|
||||
(stats.getIpFamilyOfRemote() == LinphoneAddressFamily.INET_6.getInt()) ?
|
||||
"IpV6" : (stats.getIpFamilyOfRemote() == LinphoneAddressFamily.INET.getInt()) ?
|
||||
"IpV4" : "Unknown");
|
||||
formatText(senderLossRate, getString(R.string.call_stats_sender_loss_rate),
|
||||
formatText(senderLossRate, ctxt.getString(R.string.call_stats_sender_loss_rate),
|
||||
new DecimalFormat("##.##").format(stats.getSenderLossRate()) + "%");
|
||||
formatText(receiverLossRate, getString(R.string.call_stats_receiver_loss_rate),
|
||||
formatText(receiverLossRate, ctxt.getString(R.string.call_stats_receiver_loss_rate),
|
||||
new DecimalFormat("##.##").format(stats.getReceiverLossRate())+ "%");
|
||||
if (isVideo) {
|
||||
formatText(videoResolutionSent,
|
||||
getString(R.string.call_stats_video_resolution_sent),
|
||||
ctxt.getString(R.string.call_stats_video_resolution_sent),
|
||||
"\u2191 " + params.getSentVideoSize().toDisplayableString());
|
||||
formatText(videoResolutionReceived,
|
||||
getString(R.string.call_stats_video_resolution_received),
|
||||
ctxt.getString(R.string.call_stats_video_resolution_received),
|
||||
"\u2193 " + params.getReceivedVideoSize().toDisplayableString());
|
||||
}
|
||||
} else {
|
||||
|
@ -547,6 +549,7 @@ public class StatusFragment extends Fragment {
|
|||
@Override
|
||||
public void run() {
|
||||
synchronized(LinphoneManager.getLc()) {
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneCallParams params = call.getCurrentParamsCopy();
|
||||
if (params != null) {
|
||||
LinphoneCallStats audioStats = call.getAudioStats();
|
||||
|
@ -573,6 +576,7 @@ public class StatusFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f0c669c4c2155518d71e03b3312fa601336c27d9
|
||||
Subproject commit 29c556fa8ac1ab21fba1291231ffa8dea43cf32a
|
|
@ -1 +1 @@
|
|||
Subproject commit 8fbc0d7ff00a97bc07ab7a867e55195a0bc07a62
|
||||
Subproject commit 63e61b0ae0f20e6d9f790335184fa4a0fc2a90ab
|
|
@ -1 +1 @@
|
|||
Subproject commit 7de31a427206079fd715dc6f427b675471e65fd7
|
||||
Subproject commit 8a7f0868a7d35f86ff5fa422c7333f113d935e0f
|
|
@ -1 +1 @@
|
|||
Subproject commit ed8748422bdb0c8c3790ce6fea0b6e894d8adea4
|
||||
Subproject commit 31722cf5b86b71c58a442d7cd420c23130ea74e0
|
Loading…
Reference in a new issue