diff --git a/CHANGELOG b/CHANGELOG index e872c6e82..2645942bb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,5 @@ KeePassDX(2.9.10) - * + * Try to fix autofill #852 KeePassDX(2.9.9) * Detect file changes and reload database #794 diff --git a/app/src/main/java/com/kunzisoft/keepass/autofill/AutofillHelper.kt b/app/src/main/java/com/kunzisoft/keepass/autofill/AutofillHelper.kt index f169c2655..aba7353a8 100644 --- a/app/src/main/java/com/kunzisoft/keepass/autofill/AutofillHelper.kt +++ b/app/src/main/java/com/kunzisoft/keepass/autofill/AutofillHelper.kt @@ -64,8 +64,12 @@ object AutofillHelper { fun retrieveAutofillComponent(intent: Intent?): AutofillComponent? { intent?.getParcelableExtra(EXTRA_ASSIST_STRUCTURE)?.let { assistStructure -> - return AutofillComponent(assistStructure, - intent.getParcelableExtra(EXTRA_INLINE_SUGGESTIONS_REQUEST)) + return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + AutofillComponent(assistStructure, + intent.getParcelableExtra(EXTRA_INLINE_SUGGESTIONS_REQUEST)) + } else { + AutofillComponent(assistStructure, null) + } } return null } @@ -205,10 +209,14 @@ object AutofillHelper { activity.intent?.getParcelableExtra(EXTRA_ASSIST_STRUCTURE)?.let { structure -> StructureParser(structure).parse()?.let { result -> // New Response - val inlineSuggestionsRequest = activity.intent?.getParcelableExtra(EXTRA_INLINE_SUGGESTIONS_REQUEST) - val response = buildResponse(activity, entriesInfo, result, inlineSuggestionsRequest) - if (inlineSuggestionsRequest != null) { - Toast.makeText(activity.applicationContext, R.string.autofill_inline_suggestions_keyboard, Toast.LENGTH_SHORT).show() + val response = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + val inlineSuggestionsRequest = activity.intent?.getParcelableExtra(EXTRA_INLINE_SUGGESTIONS_REQUEST) + if (inlineSuggestionsRequest != null) { + Toast.makeText(activity.applicationContext, R.string.autofill_inline_suggestions_keyboard, Toast.LENGTH_SHORT).show() + } + buildResponse(activity, entriesInfo, result, inlineSuggestionsRequest) + } else { + buildResponse(activity, entriesInfo, result, null) } val mReplyIntent = Intent() Log.d(activity.javaClass.name, "Successed Autofill auth.") diff --git a/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt b/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt index cccbe277e..cdd6e11a6 100644 --- a/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt +++ b/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt @@ -174,9 +174,9 @@ class KeeAutofillService : AutofillService() { } // Build inline presentation - var inlinePresentation: InlinePresentation? = null if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && autofillInlineSuggestionsEnabled) { + var inlinePresentation: InlinePresentation? = null inlineSuggestionsRequest?.let { val inlinePresentationSpecs = inlineSuggestionsRequest.inlinePresentationSpecs if (inlineSuggestionsRequest.maxSuggestionCount > 0 @@ -203,14 +203,10 @@ class KeeAutofillService : AutofillService() { } } } - } - - // Build response - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + // Build response responseBuilder.setAuthentication(autofillIds, intentSender, remoteViewsUnlock, inlinePresentation) - } else { - responseBuilder.setAuthentication(autofillIds, intentSender, remoteViewsUnlock) } + responseBuilder.setAuthentication(autofillIds, intentSender, remoteViewsUnlock) callback.onSuccess(responseBuilder.build()) } } diff --git a/fastlane/metadata/android/en-US/changelogs/54.txt b/fastlane/metadata/android/en-US/changelogs/54.txt index 42780ecb1..05d81dc84 100644 --- a/fastlane/metadata/android/en-US/changelogs/54.txt +++ b/fastlane/metadata/android/en-US/changelogs/54.txt @@ -1 +1 @@ - * \ No newline at end of file + * Try to fix autofill #852 \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/54.txt b/fastlane/metadata/android/fr-FR/changelogs/54.txt index 42780ecb1..5f69edea7 100644 --- a/fastlane/metadata/android/fr-FR/changelogs/54.txt +++ b/fastlane/metadata/android/fr-FR/changelogs/54.txt @@ -1 +1 @@ - * \ No newline at end of file + * Tentative de résolution de l'autofill #852 \ No newline at end of file