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
This commit is contained in:
Corey Hunter 2016-10-23 02:06:01 -07:00 committed by Moxie Marlinspike
parent f5966af781
commit 9064c02fa8
1 changed files with 9 additions and 2 deletions

View File

@ -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;