From 54549e7eb8523e6d39f503890246daacf381eff1 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 30 Dec 2015 22:15:12 +0100 Subject: [PATCH] after receiving panic trigger and locking app, remove from history This makes the app fully exit, and removes it from the Recent Apps listing. --- app/src/main/AndroidManifest.xml | 1 + .../java/com/keepassdroid/ExitActivity.java | 36 +++++++++++++++++++ .../keepassdroid/PanicResponderActivity.java | 1 + 3 files changed, 38 insertions(+) create mode 100644 app/src/main/java/com/keepassdroid/ExitActivity.java diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 09d08ce1b..0c7717f59 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -108,6 +108,7 @@ + = 21) { + finishAndRemoveTask(); + } else { + finish(); + } + + System.exit(0); + } + + public static void exitAndRemoveFromRecentApps(Activity activity) { + Intent intent = new Intent(activity, ExitActivity.class); + + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS + | Intent.FLAG_ACTIVITY_CLEAR_TASK + | Intent.FLAG_ACTIVITY_NO_ANIMATION); + + activity.startActivity(intent); + } +} diff --git a/app/src/main/java/com/keepassdroid/PanicResponderActivity.java b/app/src/main/java/com/keepassdroid/PanicResponderActivity.java index 5f6a0b3d4..d18ea0eec 100644 --- a/app/src/main/java/com/keepassdroid/PanicResponderActivity.java +++ b/app/src/main/java/com/keepassdroid/PanicResponderActivity.java @@ -23,6 +23,7 @@ protected void onCreate(Bundle savedInstanceState) { if (intent != null && PANIC_TRIGGER_ACTION.equals(intent.getAction())) { App.setShutdown(); setResult(KeePass.EXIT_LOCK); + ExitActivity.exitAndRemoveFromRecentApps(this); } if (Build.VERSION.SDK_INT >= 21) {