mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Setting to close database after Autofill selection #755
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
KeePassDX(2.9)
|
||||
* Upgrade to Android API 30 #723
|
||||
* Save new credentials with Autofill #524
|
||||
* Setting to close database after Autofill selection #755
|
||||
* Fix biometric issues #724 #740 #731
|
||||
* Fix autofill #725 #551
|
||||
* Small fixes and translations #732 #736 #737 #738 #742
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.kunzisoft.keepass.database.search.SearchHelper
|
||||
import com.kunzisoft.keepass.model.RegisterInfo
|
||||
import com.kunzisoft.keepass.model.SearchInfo
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.utils.LOCK_ACTION
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
class AutofillLauncherActivity : AppCompatActivity() {
|
||||
@@ -82,6 +83,10 @@ class AutofillLauncherActivity : AppCompatActivity() {
|
||||
{ items ->
|
||||
// Items found
|
||||
AutofillHelper.buildResponse(this, items)
|
||||
if (PreferencesUtil.isAutofillCloseDatabaseEnable(this)) {
|
||||
// Close the database
|
||||
sendBroadcast(Intent(LOCK_ACTION))
|
||||
}
|
||||
finish()
|
||||
},
|
||||
{
|
||||
|
||||
@@ -323,6 +323,7 @@ open class PasswordActivity : SpecialModeActivity() {
|
||||
},
|
||||
{
|
||||
// Simply close if database not opened, normally not happened
|
||||
onCancelSpecialMode()
|
||||
}
|
||||
)
|
||||
// Do not keep history
|
||||
@@ -336,6 +337,7 @@ open class PasswordActivity : SpecialModeActivity() {
|
||||
{ items ->
|
||||
// Response is build
|
||||
AutofillHelper.buildResponse(this, items)
|
||||
onValidateSpecialMode()
|
||||
finish()
|
||||
},
|
||||
{
|
||||
@@ -347,11 +349,13 @@ open class PasswordActivity : SpecialModeActivity() {
|
||||
searchInfo,
|
||||
readOnly)
|
||||
} else {
|
||||
onCancelSpecialMode()
|
||||
finish()
|
||||
}
|
||||
},
|
||||
{
|
||||
// Simply close if database not opened, normally not happened
|
||||
onCancelSpecialMode()
|
||||
finish()
|
||||
}
|
||||
)
|
||||
@@ -373,6 +377,7 @@ open class PasswordActivity : SpecialModeActivity() {
|
||||
},
|
||||
{
|
||||
// Simply close if database not opened, normally not happened
|
||||
onCancelSpecialMode()
|
||||
}
|
||||
)
|
||||
// Do not keep history
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.kunzisoft.keepass.activities.selection
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
@@ -10,6 +11,7 @@ import com.kunzisoft.keepass.activities.helpers.TypeMode
|
||||
import com.kunzisoft.keepass.activities.stylish.StylishActivity
|
||||
import com.kunzisoft.keepass.model.SearchInfo
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.utils.LOCK_ACTION
|
||||
import com.kunzisoft.keepass.view.SpecialModeView
|
||||
|
||||
/**
|
||||
@@ -58,6 +60,11 @@ abstract class SpecialModeActivity : StylishActivity() {
|
||||
moveTaskToBack(true)
|
||||
}
|
||||
}
|
||||
if (mTypeMode == TypeMode.AUTOFILL
|
||||
&& PreferencesUtil.isAutofillCloseDatabaseEnable(this)) {
|
||||
// Close the database
|
||||
sendBroadcast(Intent(LOCK_ACTION))
|
||||
}
|
||||
}
|
||||
|
||||
open fun onCancelSpecialMode() {
|
||||
|
||||
@@ -383,6 +383,13 @@ object PreferencesUtil {
|
||||
context.resources.getBoolean(R.bool.keyboard_previous_fill_in_default))
|
||||
}
|
||||
|
||||
fun isAutofillCloseDatabaseEnable(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.autofill_close_database_key),
|
||||
context.resources.getBoolean(R.bool.autofill_close_database_default))
|
||||
}
|
||||
|
||||
|
||||
fun isAutofillAutoSearchEnable(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.autofill_auto_search_key),
|
||||
|
||||
@@ -139,6 +139,8 @@
|
||||
<bool name="keyboard_previous_database_credentials_default" translatable="false">false</bool>
|
||||
<string name="keyboard_previous_fill_in_key" translatable="false">keyboard_previous_fill_in_key</string>
|
||||
<bool name="keyboard_previous_fill_in_default" translatable="false">false</bool>
|
||||
<string name="autofill_close_database_key" translatable="false">autofill_close_database_key</string>
|
||||
<bool name="autofill_close_database_default" translatable="false">false</bool>
|
||||
<string name="autofill_auto_search_key" translatable="false">autofill_auto_search_key</string>
|
||||
<bool name="autofill_auto_search_default" translatable="false">true</bool>
|
||||
<string name="autofill_save_search_info_key" translatable="false">autofill_save_search_info_key</string>
|
||||
|
||||
@@ -403,6 +403,8 @@
|
||||
<string name="keyboard_previous_database_credentials_summary">Automatically switch back to the previous keyboard on the database credentials screen</string>
|
||||
<string name="keyboard_previous_fill_in_title">Auto key action</string>
|
||||
<string name="keyboard_previous_fill_in_summary">Automatically switch back to the previous keyboard after executing "Auto key action"</string>
|
||||
<string name="autofill_close_database_title">Close database</string>
|
||||
<string name="autofill_close_database_summary">Close the database after an autofill selection</string>
|
||||
<string name="autofill_auto_search_title">Auto search</string>
|
||||
<string name="autofill_auto_search_summary">Automatically suggest search results from the web domain or application ID</string>
|
||||
<string name="autofill_save_search_info_title">Save search info</string>
|
||||
|
||||
@@ -19,20 +19,25 @@
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory
|
||||
android:title="@string/search_label">
|
||||
android:title="@string/general">
|
||||
<SwitchPreference
|
||||
android:key="@string/autofill_close_database_key"
|
||||
android:title="@string/autofill_close_database_title"
|
||||
android:summary="@string/autofill_close_database_summary"
|
||||
android:defaultValue="@bool/autofill_close_database_default"/>
|
||||
<SwitchPreference
|
||||
android:key="@string/autofill_auto_search_key"
|
||||
android:title="@string/autofill_auto_search_title"
|
||||
android:summary="@string/autofill_auto_search_summary"
|
||||
android:defaultValue="@bool/autofill_auto_search_default"/>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="@string/save">
|
||||
<SwitchPreference
|
||||
android:key="@string/autofill_save_search_info_key"
|
||||
android:title="@string/autofill_save_search_info_title"
|
||||
android:summary="@string/autofill_save_search_info_summary"
|
||||
android:defaultValue="@bool/autofill_save_search_info_default"/>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="@string/save">
|
||||
<SwitchPreference
|
||||
android:key="@string/autofill_ask_to_save_data_key"
|
||||
android:title="@string/autofill_ask_to_save_data_title"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
* Upgrade to Android API 30 #723
|
||||
* Save new credentials with Autofill #524
|
||||
* Setting to close database after Autofill selection #755
|
||||
* Fix biometric issues #724 #740 #731
|
||||
* Fix autofill #725 #551
|
||||
* Small fixes and translations #732 #736 #737 #738 #742
|
||||
@@ -1,5 +1,6 @@
|
||||
* Mise à jour vers Android API 30 #723
|
||||
* Sauvegarde de nouveaux identifiants avec le remplissage automatique #524
|
||||
* Paramètre pour fermer la base de données après une sélection de remplissage automatique #755
|
||||
* Correction de problèmes biométriques #724 #740 #731
|
||||
* Correction de l'autofill #725 #551
|
||||
* Petites corrections et traductions #732 #736 #737 #738 #742
|
||||
Reference in New Issue
Block a user