From 4f7744999f7f85fa9390cb9617999628fb3e5400 Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Sat, 3 Aug 2013 12:33:19 +0200 Subject: [PATCH] EntryActivity.cs: Ensure notifications don't pop up if locked QuickUnlock.cs: ensure keyboard shows up also OnResume App.cs: use GetDb() to ensure db is not null --- src/keepass2android/EntryActivity.cs | 2 +- src/keepass2android/QuickUnlock.cs | 20 ++++++++++++-------- src/keepass2android/app/App.cs | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/keepass2android/EntryActivity.cs b/src/keepass2android/EntryActivity.cs index 07015231..b7d2bc2a 100644 --- a/src/keepass2android/EntryActivity.cs +++ b/src/keepass2android/EntryActivity.cs @@ -94,7 +94,7 @@ namespace keepass2android Database db = App.Kp2a.GetDb(); // Likely the app has been killed exit the activity - if (! db.Loaded) + if (!db.Loaded || (App.Kp2a.QuickLocked)) { Finish(); return; diff --git a/src/keepass2android/QuickUnlock.cs b/src/keepass2android/QuickUnlock.cs index f516bc27..151cc671 100644 --- a/src/keepass2android/QuickUnlock.cs +++ b/src/keepass2android/QuickUnlock.cs @@ -65,15 +65,11 @@ namespace keepass2android txtLabel.Text = GetString(Resource.String.QuickUnlock_label, new Java.Lang.Object[]{quickUnlockLength}); - EditText pwd= (EditText)FindViewById(Resource.Id.QuickUnlock_password); - pwd.SetEms(quickUnlockLength); - pwd.PostDelayed(() => { - InputMethodManager keyboard = (InputMethodManager)GetSystemService(Context.InputMethodService); - keyboard.ShowSoftInput(pwd, 0); - }, 50); - SetResult(KeePass.ExitChangeDb); - + + EditText pwd = (EditText)FindViewById(Resource.Id.QuickUnlock_password); + pwd.SetEms(quickUnlockLength); + Button btnUnlock = (Button)FindViewById(Resource.Id.QuickUnlock_button); btnUnlock.Click += (object sender, EventArgs e) => { @@ -110,6 +106,14 @@ namespace keepass2android Finish(); return; } + + EditText pwd = (EditText)FindViewById(Resource.Id.QuickUnlock_password); + pwd.PostDelayed(() => + { + InputMethodManager keyboard = (InputMethodManager)GetSystemService(Context.InputMethodService); + keyboard.ShowSoftInput(pwd, 0); + }, 50); + } } } diff --git a/src/keepass2android/app/App.cs b/src/keepass2android/app/App.cs index 58f49862..7d38895b 100644 --- a/src/keepass2android/app/App.cs +++ b/src/keepass2android/app/App.cs @@ -64,7 +64,7 @@ namespace keepass2android { public void LockDatabase(bool allowQuickUnlock = true) { - if (_db.Loaded) + if (GetDb().Loaded) { if (QuickUnlockEnabled && allowQuickUnlock && _db.KpDatabase.MasterKey.ContainsType(typeof(KcpPassword)) &&