mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-06 00:32:32 -08:00
Fix locking for preference activity.
This commit is contained in:
1 parent
32743da30a
commit
e168eefcc8
7 files changed
+87
-13
No files matched your search
@@ -32,7 +32,7 @@ public class LockCloseActivity extends LockingActivity {
|
||||
}
|
||||
|
||||
private void checkShutdown() {
|
||||
if ( App.isShutdown() ) {
|
||||
if ( App.isShutdown() && App.getDB().Loaded() ) {
|
||||
setResult(KeePass.EXIT_LOCK);
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class LockCloseListActivity extends LockingListActivity {
|
||||
}
|
||||
|
||||
private void checkShutdown() {
|
||||
if ( App.isShutdown() ) {
|
||||
if ( App.isShutdown() && App.getDB().Loaded() ) {
|
||||
setResult(KeePass.EXIT_LOCK);
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ package com.keepassdroid;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.keepassdroid.app.App;
|
||||
import com.keepassdroid.timers.Timeout;
|
||||
|
||||
public class LockingActivity extends Activity {
|
||||
@@ -28,15 +29,17 @@ public class LockingActivity extends Activity {
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
Timeout.start(this);
|
||||
if ( App.getDB().Loaded() ) {
|
||||
Timeout.start(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
Timeout.cancel(this);
|
||||
|
||||
if ( App.getDB().Loaded() ) {
|
||||
Timeout.cancel(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.keepassdroid;
|
||||
|
||||
import com.android.keepass.KeePass;
|
||||
import com.keepassdroid.app.App;
|
||||
|
||||
public class LockingClosePreferenceActivity extends LockingPreferenceActivity {
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
checkShutdown();
|
||||
}
|
||||
|
||||
private void checkShutdown() {
|
||||
if ( App.isShutdown() && App.getDB().Loaded() ) {
|
||||
setResult(KeePass.EXIT_LOCK);
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,21 +21,24 @@ package com.keepassdroid;
|
||||
|
||||
import android.app.ListActivity;
|
||||
|
||||
import com.keepassdroid.app.App;
|
||||
import com.keepassdroid.timers.Timeout;
|
||||
|
||||
public class LockingListActivity extends ListActivity {
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
Timeout.start(this);
|
||||
if ( App.getDB().Loaded() ) {
|
||||
Timeout.start(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
Timeout.cancel(this);
|
||||
if ( App.getDB().Loaded() ) {
|
||||
Timeout.cancel(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009 Brian Pellin.
|
||||
*
|
||||
* This file is part of KeePassDroid.
|
||||
*
|
||||
* KeePassDroid is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDroid is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDroid. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.keepassdroid;
|
||||
|
||||
import com.keepassdroid.app.App;
|
||||
import com.keepassdroid.timers.Timeout;
|
||||
|
||||
import android.preference.PreferenceActivity;
|
||||
|
||||
public class LockingPreferenceActivity extends PreferenceActivity {
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
if ( App.getDB().Loaded() ) {
|
||||
Timeout.start(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if ( App.getDB().Loaded() ) {
|
||||
Timeout.cancel(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,15 +23,15 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.preference.Preference.OnPreferenceChangeListener;
|
||||
|
||||
import com.android.keepass.R;
|
||||
import com.keepassdroid.Database;
|
||||
import com.keepassdroid.LockingClosePreferenceActivity;
|
||||
import com.keepassdroid.app.App;
|
||||
import com.keepassdroid.fileselect.FileDbHelper;
|
||||
|
||||
public class AppSettingsActivity extends PreferenceActivity {
|
||||
public class AppSettingsActivity extends LockingClosePreferenceActivity {
|
||||
public static boolean KEYFILE_DEFAULT = false;
|
||||
|
||||
public static void Launch(Context ctx) {
|
||||
|
||||
Reference in new issue
Block a user