How to stop dialog save password to Google on Android 14?

392 Views Asked by At

Since Android 8 to 13, when you want to disable Password Manager's saving password we only need to include this:

android:importantForAutofill="no"

But it seems something changed in Android 14 and that autofield exclusion doesn't work.

I also tried to include

android:importantForAutofill="noExcludeDescendants"

on the parent's layout.

Also, I tried to remove android:inputType="textEmailAddress" and android:inputType="textPassword" in the TextInputEditText, but it also doesn't work.

This is the dialog that is shown in Android 14.

Google Password Manager save dialog

2

There are 2 best solutions below

0
On

I got the same bug also.

I used

android:importantForAutofill="no" but this is no longer blocking the dialog to appear.

I tried also to use:

android:isCredential="true"
https://developer.android.com/training/sign-in/passkeys

but there was no change. The autofill was still working.

EDIT It seems like that I found a working solution:

Create your own EditText Class and do following:

    override fun getAutofillType(): Int {
        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            AUTOFILL_TYPE_NONE
        } else {
            super.getAutofillType()
        }
    }

I got the solution from here:
https://stackoverflow.com/a/46698028/7655782

0
On

According to this issue in the Google Issue Tracker, this appears to be intended behavior:

Status: Won't Fix (Intended Behavior) Thanks for submitting this feedback.

This behavior is working as intended on Android 14, as we updated the behavior of “autofill importance”. In Android 14+, Views where Views#isImportantForAutofill is no or noExcludeDescendants will typically trigger autofill when focused and are always included in the FillRequest data, and autofill providers will be able to show suggestions when relevant.

The Android Autofill team is constantly looking for ways to improve the user experience. With this change, we expect users will be able to use autofill more often when they need it. Additional details can be found in the documentation.

So this is not a bug, Google just wants to "encourage" people to use this feature. Please check the answer from @Michael Winkler for a workaround.