Password Manager Can't Autofill on Xiaomi Android Devices

Like many others, I store my credentials in a password manager.

I previously used KeepassXC but have since migrated most credentials over to 1Password because of the ability to share vaults (this forms part of my approach to avoiding lockout, as well as helping ensure continued access if something nasty were to happen to me).

There isn't/wasn't an Android build of KeepassXC, so I was using the Keepass2Android app on my phone.

Although very good password managers, both Keepass2Android and 1Password encountered issues on my Android phone.

Both apps worked flawlessly, initially, but at some point their respective integrations stopped working and it was no longer possible to have them insert credentials into login forms for me. Instead, I had to switch into their app, copy the credentials to the clipboard, switch back to the browser and attempt to paste (hoping that the site I was on hadn't stupidly disabled paste on it's login form).

The broken behaviour was quite odd, a prompt would still be shown detailing available and relevant credentials

Screenshot of 1Password listing available credentials for a login form

Selecting an option did nothing, credentials weren't filled and choosing Open 1Password didn't result in the app being opened.

I tried variations, but it didn't work even if I logged into the password manager app first. Inter-app communication clearly worked, because the prompt always showed options relevant to the current page, it just seemed unable to push passwords into the form.

This post details the cause and the annoyingly simple fix for this issue.


Credit

Firstly, I'm not the original source of this fix.

All credit goes to the 1Password Support Team who resolved the issue for me in a single email

Mastodon post by me: I don't think they're on here yet, but all the same, big shout out to #1Password this morning. I've had an issue with 1Password on my phone for months that I just didn't get around to doing anything about: suggestions would pop up in forms, but hitting them did nothing. 1 email to their support, and from the description of the problem they figured it was a Xiaomi device. Turns out Xiaomi have added a permission and defaulted it to false. Happy days :)

The reason that I'm documenting this is because my own searches hadn't found the answer to what, presumably, is quite a common issue for Xiaomi users, so I wanted to try and help surface the information.


The Issue

Xioami introduced a new permission a couple of years ago, labelled in settings as Display pop-up windows while running in the background. Because of the traditional mobile manufacturer lag in sending updates to older phones, some will only have received this change much more recently.

The default for the new permission is Deny and it can only be granted manually, so most apps (including 1Password) won't have it.

Apps without this permission are left unable to do much in the background, so although 1Password should receive the signal to auto-fill your selected credential, it won't actually be able to do anthing with it and certainly can't launch a pop-up to have you unlock the vault.

With the benefit of hindsight, it looks like introduction of the permission caused some consternation in various places at the time.


The Fix

The fix is simple: the password manager just needs to be granted the relevant permission.

Go to

  • Settings
  • Apps
  • Manage Apps

Enter the name of your password manager app into the Search box, and tap into the app when it appears.

At the bottom of the screen is an option labelled Other Permissions:

MIUI App Settings View

Tap into the Other Permissions menu, and you should see the Display pop-up windows while running in the background with a red cross next to it:

Display pop-up windows whilst running in the background permission shows as disabled

Tap the permission to open the context menu, choose Accept and the permission should have a green tick to indicate that it's been granted

Xiaomi MIUI "Other Permissions" view

Come back out of settings and open your original application. When you hit a login page/form, your password manager should now be able to fill your selected credentials.


Conclusion

This issue has plagued me for quite a while. When Keepass2Android originally broke, I fiddled around with it a bit but ultimately resigned myself to using copy & paste (the app relies on a custom keyboard, which had periodically had other issues, so I assumed the issue was something related to that).

When I migrated to 1Password, I was delighted to find that that autofill worked seamlessly. One day, though, it too stopped working (presumably my phone automatically updated overnight).

I searched around, but searching terms like "1password doesn't autofill android" or "1password doesn't open from browser" returns lots of results, but nothing obviously relevant (it's the old issue of needing to know what you're actually searching for).

With the benefit of a bit more knowledge about the issue, I have since been able to find one relevant hit, although it is also possible that it was posted after I first encountered the issue.

Like so many other things, the problem with autofill went onto my "must get around to sorting that" pile and I carried on reliant on Copy+Paste. Eventually I got around to looking further into it (because of frustration at an app that had disabled paste), struck out again and then thought I'd email 1Password's support to see if they could point me in the right direction.

I had a response and the answer within a day.

It probably should have occurred to me to suspect MIUI: Xiaomi make some very nice hardware, but their interface (MIUI) is absolutely loaded with gotchas:

As much as I like my Mi Mix 2, the next phone definitely won't be a Xiaomi.