diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/BugReportActivity.java b/app/src/main/java/com/github/yeriomin/yalpstore/BugReportActivity.java deleted file mode 100644 index 9e1a1d731..000000000 --- a/app/src/main/java/com/github/yeriomin/yalpstore/BugReportActivity.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.github.yeriomin.yalpstore; - -import android.app.Activity; -import android.content.ActivityNotFoundException; -import android.content.Intent; -import android.os.Bundle; -import android.text.TextUtils; -import android.view.View; -import android.widget.EditText; -import android.widget.TextView; - -import com.github.yeriomin.yalpstore.bugreport.BugReportService; - -public class BugReportActivity extends Activity { - - private String stackTrace; - private boolean triggeredByCrash; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.bugreport_activity_layout); - onNewIntent(getIntent()); - } - - @Override - protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - setIntent(intent); - stackTrace = intent.getStringExtra(BugReportService.INTENT_STACKTRACE); - triggeredByCrash = !TextUtils.isEmpty(stackTrace); - setTitle(triggeredByCrash ? R.string.dialog_title_application_crashed : R.string.action_bug_report); - ((TextView) findViewById(R.id.explanation)).setText(triggeredByCrash ? R.string.bug_report_explanation_crash : R.string.bug_report_explanation_bug_report); - if (!PreferenceActivity.getBoolean(this, PlayStoreApiAuthenticator.PREFERENCE_APP_PROVIDED_EMAIL)) { - ((EditText) findViewById(R.id.identification)).setText(PreferenceActivity.getString(this, PlayStoreApiAuthenticator.PREFERENCE_EMAIL)); - } - } - - public void sendBugReport(View view) { - ContextUtil.toastShort(getApplicationContext(), getString(R.string.thank_you)); - startService(getBugReportIntent( - stackTrace, - ((EditText) findViewById(R.id.message)).getText().toString(), - ((EditText) findViewById(R.id.identification)).getText().toString() - )); - finishAndGoToHomeScreen(view); - } - - public void finishAndGoToHomeScreen(View view) { - finish(); - if (triggeredByCrash) { - goToHomeScreen(); - } - } - - private void goToHomeScreen() { - Intent intent = new Intent(Intent.ACTION_MAIN); - intent.addCategory(Intent.CATEGORY_HOME); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - try { - startActivity(intent); - } catch (ActivityNotFoundException e) { - // No home screen? - } - } - - private Intent getBugReportIntent(String stackTrace, String message, String identification) { - Intent intentBugReport = new Intent(getApplicationContext(), BugReportService.class); - intentBugReport.setAction(BugReportService.ACTION_SEND_FTP); - intentBugReport.putExtra(BugReportService.INTENT_STACKTRACE, stackTrace); - intentBugReport.putExtra(BugReportService.INTENT_MESSAGE, message); - intentBugReport.putExtra(BugReportService.INTENT_IDENTIFICATION, identification); - return intentBugReport; - } -} diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreActivity.java b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreActivity.java index aeaadeeba..e0f058e5c 100644 --- a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreActivity.java +++ b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreActivity.java @@ -104,9 +104,6 @@ public abstract class YalpStoreActivity extends Activity { case R.id.action_about: startActivity(new Intent(this, AboutActivity.class)); break; - case R.id.action_bug_report: - startActivity(new Intent(this, BugReportActivity.class)); - break; case R.id.filter_system_apps: case R.id.filter_apps_with_ads: case R.id.filter_paid_apps: diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreApplication.java b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreApplication.java index 2fde782c2..60ffc74e3 100644 --- a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreApplication.java +++ b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreApplication.java @@ -66,7 +66,6 @@ public class YalpStoreApplication extends Application { } } PreferenceManager.setDefaultValues(this, R.xml.settings, false); - Thread.setDefaultUncaughtExceptionHandler(new YalpStoreUncaughtExceptionHandler(getApplicationContext())); registerDownloadReceiver(); registerInstallReceiver(); } diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreUncaughtExceptionHandler.java b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreUncaughtExceptionHandler.java deleted file mode 100644 index 258370247..000000000 --- a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreUncaughtExceptionHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.github.yeriomin.yalpstore; - -import android.content.Context; -import android.content.Intent; - -import com.github.yeriomin.yalpstore.bugreport.BugReportService; - -class YalpStoreUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { - - private Context context; - - public YalpStoreUncaughtExceptionHandler(Context context) { - this.context = context; - } - - @Override - public void uncaughtException(Thread t, final Throwable e) { - e.printStackTrace(); - Intent errorIntent = new Intent(context.getApplicationContext(), BugReportActivity.class); - errorIntent.putExtra(BugReportService.INTENT_STACKTRACE, getStackTraceString(e)); - errorIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); - context.getApplicationContext().startActivity(errorIntent); - System.exit(0); - } - - private String getStackTraceString(Throwable e) { - StringBuilder stackTrace = new StringBuilder(); - Throwable ex = e; - while (null != ex) { - stackTrace - .append(ex.getClass().getName()) - .append(": \"") - .append(ex.getMessage()) - .append("\"\n") - ; - for (StackTraceElement element: ex.getStackTrace()) { - stackTrace - .append("\tat ") - .append(element.getClassName()) - .append(".") - .append(element.getMethodName()) - .append("(") - .append(element.getFileName()) - .append(":") - .append(element.getLineNumber()) - .append(")\n") - ; - } - ex = ex.getCause(); - if (null != ex) { - stackTrace.append("Caused by: "); - } - } - return stackTrace.toString(); - } -} diff --git a/app/src/main/res/drawable-anydpi-v21/ic_bug_report.xml b/app/src/main/res/drawable-anydpi-v21/ic_bug_report.xml deleted file mode 100644 index 2a18afef9..000000000 --- a/app/src/main/res/drawable-anydpi-v21/ic_bug_report.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_bug_report.png b/app/src/main/res/drawable/ic_bug_report.png deleted file mode 100644 index 7a73d7882..000000000 Binary files a/app/src/main/res/drawable/ic_bug_report.png and /dev/null differ diff --git a/app/src/main/res/layout/bugreport_activity_layout.xml b/app/src/main/res/layout/bugreport_activity_layout.xml deleted file mode 100644 index 9d277a04c..000000000 --- a/app/src/main/res/layout/bugreport_activity_layout.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -