-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle fingerprint changed more gracefully
- Loading branch information
Showing
7 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ | |
import android.app.Dialog; | ||
import android.content.Context; | ||
import android.content.DialogInterface; | ||
import android.content.Intent; | ||
import android.graphics.Color; | ||
import android.graphics.drawable.Drawable; | ||
import android.hardware.fingerprint.FingerprintManager; | ||
import android.net.Uri; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.os.CancellationSignal; | ||
|
@@ -23,6 +25,9 @@ | |
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import java.io.PrintWriter; | ||
import java.io.StringWriter; | ||
|
||
import javax.crypto.Cipher; | ||
|
||
import butterknife.ButterKnife; | ||
|
@@ -153,6 +158,41 @@ public void onShow(DialogInterface unused) { | |
dismiss(); | ||
defaultPrefs.fingerprintEnabled(false); | ||
SnackbarUtil.showLong(App.get().getCurrentForegroundActivity(), e.getMessage()); | ||
Throwable cause = e; | ||
String stacktrace = ""; | ||
do { | ||
StringWriter sw = new StringWriter(); | ||
PrintWriter pw = new PrintWriter(sw); | ||
cause.printStackTrace(pw); | ||
stacktrace += sw.toString(); | ||
cause = cause.getCause(); | ||
} while (cause != null && cause != e); | ||
|
||
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts( | ||
"mailto", "[email protected]", null)); | ||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Master Password Feedback"); | ||
String mailTemplate = "\n\n\n-----\n" + | ||
"App Version: %s\n" + | ||
"App Version Code: %d\n" + | ||
"OS Version: %s\n" + | ||
"API Level: %d\n" + | ||
"Android Version: %s\n" + | ||
"Device Manufacturer: %s\n" + | ||
"Device Codename: %s\n" + | ||
"Device Model: %s\n" + | ||
"Stacktrace: %s"; | ||
String mailText = String.format(mailTemplate, | ||
defaultPrefs.versionName(), | ||
defaultPrefs.versionCode(), | ||
System.getProperty("os.version"), | ||
Build.VERSION.SDK_INT, | ||
Build.VERSION.RELEASE, | ||
Build.MANUFACTURER, | ||
Build.DEVICE, | ||
Build.MODEL, | ||
stacktrace); | ||
emailIntent.putExtra(Intent.EXTRA_TEXT, mailText); | ||
getContext().startActivity(Intent.createChooser(emailIntent, getContext().getString(R.string.title_feedback))); | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters