Improved collect logs function
This commit is contained in:
parent
e4882b32f5
commit
bf8b533687
2 changed files with 3 additions and 3 deletions
|
@ -75,7 +75,7 @@ public class AboutFragment extends Fragment implements OnClickListener {
|
||||||
if (LinphoneActivity.isInstanciated()) {
|
if (LinphoneActivity.isInstanciated()) {
|
||||||
|
|
||||||
if (getResources().getBoolean(R.bool.enable_log_collect)) {
|
if (getResources().getBoolean(R.bool.enable_log_collect)) {
|
||||||
LinphoneUtils.collectLogs(getString(R.string.app_name), getString(R.string.about_bugreport_email));
|
LinphoneUtils.collectLogs(LinphoneActivity.instance(), getString(R.string.about_bugreport_email));
|
||||||
} else {
|
} else {
|
||||||
LinphoneActivity.instance().exit();
|
LinphoneActivity.instance().exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,7 +341,7 @@ public final class LinphoneUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void collectLogs(String logTag, String email) {
|
public static void collectLogs(Context context, String email) {
|
||||||
BufferedReader br = null;
|
BufferedReader br = null;
|
||||||
Process p = null;
|
Process p = null;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -362,7 +362,7 @@ public final class LinphoneUtils {
|
||||||
i.putExtra(Intent.EXTRA_SUBJECT, "Linphone Logs");
|
i.putExtra(Intent.EXTRA_SUBJECT, "Linphone Logs");
|
||||||
i.putExtra(Intent.EXTRA_TEXT, sb.toString());
|
i.putExtra(Intent.EXTRA_TEXT, sb.toString());
|
||||||
try {
|
try {
|
||||||
LinphoneActivity.instance().startActivity(Intent.createChooser(i, "Send mail..."));
|
context.startActivity(Intent.createChooser(i, "Send mail..."));
|
||||||
} catch (android.content.ActivityNotFoundException ex) {
|
} catch (android.content.ActivityNotFoundException ex) {
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in a new issue