From 9064c02fa8d92a3d9e4fc77324b320b671a22b42 Mon Sep 17 00:00:00 2001 From: Corey Hunter Date: Sun, 23 Oct 2016 02:06:01 -0700 Subject: [PATCH] Improve #3990 By catching the crash Signal remains unlocked. The user can quickly retry sharing from the previous app and it will work, rather than having to return to the home screen and unlock Signal. Closes #5805 // FREEBIE --- .../thoughtcrime/securesms/PassphraseActivity.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/PassphraseActivity.java b/src/org/thoughtcrime/securesms/PassphraseActivity.java index 11935f8fe0..71bbc2cc3e 100644 --- a/src/org/thoughtcrime/securesms/PassphraseActivity.java +++ b/src/org/thoughtcrime/securesms/PassphraseActivity.java @@ -21,6 +21,7 @@ import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.IBinder; +import android.util.Log; import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.service.KeyCachingService; @@ -57,10 +58,16 @@ public abstract class PassphraseActivity extends BaseActionBarActivity { cleanup(); Intent nextIntent = getIntent().getParcelableExtra("next_intent"); - if (nextIntent != null) startActivity(nextIntent); + if (nextIntent != null) { + try { + startActivity(nextIntent); + } catch (java.lang.SecurityException e) { + Log.w("PassphraseActivity", + "Access permission not passed from PassphraseActivity, retry sharing."); + } + } finish(); } - @Override public void onServiceDisconnected(ComponentName name) { keyCachingService = null;