diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 9e5ae669a..5a301dee1 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -155,17 +155,19 @@
-
-
+
+
-
-
-
-
+
+
+
+
+
+
diff --git a/res/layout/about.xml b/res/layout/about.xml
index 155d9a657..ab2a6883f 100644
--- a/res/layout/about.xml
+++ b/res/layout/about.xml
@@ -9,4 +9,10 @@
android:layout_height="wrap_content" android:text="@string/about_text"
android:autoLink="web" android:gravity="center" android:paddingTop="50sp"
android:textStyle="bold" android:id="@+id/AboutText">
+
diff --git a/res/values/custom.xml b/res/values/custom.xml
index 0b88d1c01..a5602db26 100644
--- a/res/values/custom.xml
+++ b/res/values/custom.xml
@@ -6,7 +6,6 @@
test.linphone.org
true
-
false
true
@@ -19,5 +18,8 @@
true
Registered to %s
Fails to register to %s
+
+ Linphone %s SIP (rfc 3261) compatible phone under GNU Public License V2\n http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications
+ linphone-android@belledonne-communications.com
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 602a9f54a..f715b4e77 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -74,7 +74,12 @@
Codecs
Place a call
Debug
-Linphone %s SIP (rfc 3261) compatible phone under GNU Public License V2\n http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications
+Report issue
+Describe problem here
+Error generating bug report
+Logs not found.
+Reading logs, may takes time...
+Send bug report with...
About
Audio
Exit
diff --git a/src/org/linphone/AboutActivity.java b/src/org/linphone/AboutActivity.java
index 1a2df24a5..8fd0c7474 100644
--- a/src/org/linphone/AboutActivity.java
+++ b/src/org/linphone/AboutActivity.java
@@ -15,29 +15,152 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
+ */
package org.linphone;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
import org.linphone.core.Log;
import android.app.Activity;
+import android.content.Intent;
+import android.content.SharedPreferences;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.net.Uri;
import android.os.Bundle;
+import android.os.Handler;
+import android.preference.PreferenceManager;
+import android.view.View;
+import android.view.View.OnClickListener;
import android.widget.TextView;
+import android.widget.Toast;
-public class AboutActivity extends Activity {
- TextView aboutText;
+public class AboutActivity extends Activity implements OnClickListener {
+
+ private Handler mHandler = new Handler();
+
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
- aboutText = (TextView) findViewById(R.id.AboutText);
+
+ TextView aboutText = (TextView) findViewById(R.id.AboutText);
try {
aboutText.setText(String.format(getString(R.string.about_text), getPackageManager().getPackageInfo(getPackageName(), 0).versionName));
} catch (NameNotFoundException e) {
Log.e(e, "cannot get version name");
}
- }
-
+
+ SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
+ if (pref.getBoolean(getString(R.string.pref_debug_key), false)) {
+ View issue = findViewById(R.id.about_report_issue);
+ issue.setOnClickListener(this);
+ issue.setVisibility(View.VISIBLE);
+ }
+ }
+
+ private Thread thread;
+ @Override
+ public void onClick(View v) {
+ if (thread != null) return;
+ Toast.makeText(this, getString(R.string.about_reading_logs), Toast.LENGTH_LONG).show();
+ thread = new ReadLogThread();
+ thread.start();
+ }
+
+ private void onLogsRead(String logs) {
+ File tempFile;
+ if (logs == null) {
+ Toast.makeText(this, getString(R.string.about_logs_not_found), Toast.LENGTH_SHORT).show();
+ } else {
+
+ try {
+ tempFile = File.createTempFile("bugreport", ".txt");
+ tempFile.deleteOnExit();
+ FileWriter writer = new FileWriter(tempFile);
+ writer.append(logs);
+ } catch (IOException e) {
+ Toast.makeText(this, getString(R.string.about_error_generating_bugreport_attachement), Toast.LENGTH_LONG).show();
+ Log.e(e, "couldn't write to temporary file");
+ return;
+ } finally {
+ thread = null;
+ }
+
+
+ Intent intent = new Intent(Intent.ACTION_SEND);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setType("plain/text");
+ intent.putExtra(Intent.EXTRA_EMAIL, new String[]{getString(R.string.about_bugreport_email)});
+ intent.putExtra(Intent.EXTRA_SUBJECT,"Bug report " + getString(R.string.app_name) + "-android");
+ intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.about_bugreport_email_text));
+ intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(tempFile));
+ intent = Intent.createChooser(intent,getString(R.string.about_mailer_chooser_text));
+ startActivityForResult(intent, 0);
+ }
+ }
+
+
+ private class ReadLogThread extends Thread {
+ @Override
+ public void run() {
+ final String logs = readLogs();
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ onLogsRead(logs);
+ }
+ });
+ super.run();
+ }
+ }
+
+ private String readLogs() {
+ StringBuilder sb1 = null;
+ StringBuilder sb2 = null;
+ BufferedReader br = null;
+ Process p = null;
+
+ try {
+ p = Runtime.getRuntime().exec(new String[] {"logcat", "-d"});
+ br = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
+
+ String line;
+ while ((line = br.readLine()) != null) {
+ if (line.contains(LinphoneService.START_LINPHONE_LOGS)) {
+ if (sb1 != null) {
+ sb2 = sb1;
+ }
+ sb1 = new StringBuilder();
+ }
+ if (sb1 != null) {
+ sb1.append(line).append('\n');
+ }
+ }
+
+ if (sb1 == null) return null;
+ if (sb2 != null) {
+ sb1.append(sb2);
+ }
+ return sb1.toString();
+ } catch (IOException e) {
+ Log.e(e, "Error while reading logs");
+ return null;
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {}
+ }
+ if (p != null) {
+ p.destroy();
+ }
+ }
+ }
+
}
diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java
index 2acc250b9..ce75cf533 100644
--- a/src/org/linphone/LinphoneService.java
+++ b/src/org/linphone/LinphoneService.java
@@ -28,7 +28,6 @@ import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCore.GlobalState;
import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.mediastream.Version;
-import org.linphone.mediastream.video.capture.hwconf.Hacks;
import android.app.Notification;
import android.app.NotificationManager;
@@ -41,6 +40,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.media.MediaPlayer;
import android.media.RingtoneManager;
import android.net.Uri;
+import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.preference.PreferenceManager;
@@ -111,7 +111,8 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
notificationTitle = getString(R.string.app_name);
// Dump some debugging information to the logs
- Hacks.dumpDeviceInformation();
+ Log.i(START_LINPHONE_LOGS);
+ dumpDeviceInformation();
dumpInstalledLinphoneInformation();
mNotificationMgr = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
@@ -130,6 +131,18 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
+ public static final String START_LINPHONE_LOGS = " ==== Phone information dump ====";
+ private void dumpDeviceInformation() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("DEVICE=").append(Build.DEVICE).append("\n");
+ sb.append("MODEL=").append(Build.MODEL).append("\n");
+ //MANUFACTURER doesn't exist in android 1.5.
+ //sb.append("MANUFACTURER=").append(Build.MANUFACTURER).append("\n");
+ sb.append("SDK=").append(Build.VERSION.SDK);
+ Log.i(sb.toString());
+ }
+
+
private void dumpInstalledLinphoneInformation() {
PackageInfo info = null;
diff --git a/src/org/linphone/core/LinphoneCoreFactoryImpl.java b/src/org/linphone/core/LinphoneCoreFactoryImpl.java
index 19b0282f3..1591a8b4e 100644
--- a/src/org/linphone/core/LinphoneCoreFactoryImpl.java
+++ b/src/org/linphone/core/LinphoneCoreFactoryImpl.java
@@ -19,21 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package org.linphone.core;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import java.security.cert.PKIXParameters;
-import java.security.cert.TrustAnchor;
-import java.security.cert.X509Certificate;
-import java.util.Iterator;
-
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.X509TrustManager;
import org.linphone.mediastream.Version;
diff --git a/src/org/linphone/core/LinphoneCoreImpl.java b/src/org/linphone/core/LinphoneCoreImpl.java
index a45bad1c7..92eb4a43c 100644
--- a/src/org/linphone/core/LinphoneCoreImpl.java
+++ b/src/org/linphone/core/LinphoneCoreImpl.java
@@ -23,9 +23,6 @@ import java.io.IOException;
import java.util.List;
import java.util.Vector;
-import org.linphone.LinphoneManager;
-import org.linphone.mediastream.video.AndroidVideoWindowImpl;
-
class LinphoneCoreImpl implements LinphoneCore {
diff --git a/submodules/libilbc-rfc3951 b/submodules/libilbc-rfc3951
index 5b6ac8974..af32518af 160000
--- a/submodules/libilbc-rfc3951
+++ b/submodules/libilbc-rfc3951
@@ -1 +1 @@
-Subproject commit 5b6ac8974d1a5f8059b964b329c565d4afe06358
+Subproject commit af32518af41f97caee07070234a3475409b9a27d