Skip to content

Android 11 inline autofill#1145

Merged
mpbw2 merged 7 commits intomasterfrom
android11-autofill
Nov 10, 2020
Merged

Android 11 inline autofill#1145
mpbw2 merged 7 commits intomasterfrom
android11-autofill

Conversation

@mpbw2
Copy link
Contributor

@mpbw2 mpbw2 commented Nov 10, 2020

Support for Android 11 inline autofill. If a fill request includes an InlineSuggestionsRequest (requires Android 11 plus an IME (keyboard) that supports inline presentations) then we construct the additional views according to the given restrictions (dictated by the IME within the request) and returned along with the original overlay views. The result is a horizontally-scrollable collection of ciphers anchored within the IME. The original overlay is used if no InlineSuggestionsRequest is supplied, or if anything goes wrong during the creation of the inline presentation.

Some tidbits:

  • With the exception of our logo, the inline icons are tinted according to the rules in the InlineSuggestionsRequest to allow the IME to drive the theme.
  • With some browsers this can be finicky if the browser's own autofill functions are still enabled (varies, of course)
  • Firefox (prod & beta) is currently broken as it keeps re-initializing the keyboard and erasing the inline presentation. This has been fixed in their nightly builds.

Screen Shot 2020-11-10 at 11 39 30 AM

@mpbw2 mpbw2 requested a review from a team November 10, 2020 17:25
Copy link

@cscharf cscharf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor feedback on simplifying one of the blocks, but otherwise looks good!

if (inlinePresentationSpecs != null)
{
inlinePresentationSpecsCount = inlinePresentationSpecs.Count;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block can be simplified:

inlineMaxSuggestedCount = fillRequest.InlineSuggestionsRequest?.MaxSuggestionCount ?? 0;
inlinePresentationSpecsCount = inlineSuggestionsRequest?.InlinePresentationSpecs?.Count ?? 0;

Comment on lines +152 to +154
if (fillRequest != null)
{
if ((int)Build.VERSION.SdkInt >= 30)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also combine these conditions together in one if

@mpbw2 mpbw2 merged commit 311d3dd into master Nov 10, 2020
@mpbw2 mpbw2 deleted the android11-autofill branch November 10, 2020 22:24
@yurividal
Copy link

Should this also work on Samsung's Android 11?

@mpbw2
Copy link
Contributor Author

mpbw2 commented Nov 11, 2020

Should this also work on Samsung's Android 11?

There's no reason it shouldn't, however in the end that's up to Samsung.

@yurividal
Copy link

Should this also work on Samsung's Android 11?

There's no reason it shouldn't, however in the end that's up to Samsung.

I just verified that it indeed works! Although, only on Chrome, and using the Samsung keyboard stock keyboard.
Any attempt to use Samsung Internet, Samsung internet beta, and/or gboard does not work.
I guess now we just need to wait for Samsung to implement it on their browser, and that other keyboards such as SwiftKey implement it too. Thank you bitwarden team!!

@mpbw2
Copy link
Contributor Author

mpbw2 commented Nov 11, 2020

For anyone using Brave, it seems to be working when all three of Brave's autofill features are disabled (passwords, payment methods, and Addresses). Just FYI.

@wallismith
Copy link

wallismith commented Nov 12, 2020

@mportune-bw Unfortunately, that doesn't fix the issue for Brave. It doesn't seem to work 90% of the time. I'm almost certain it's not code related. This has been an ongoing issue with Chromium browsers on Android, even before the new Android 11 keyboard auto fill API.

Looks like someone submitted patches for this issue: bitwarden/mobile#489 (comment)

@mpbw2
Copy link
Contributor Author

mpbw2 commented Nov 12, 2020

@wallismith Sorry to hear that. Autofill can be incredibly frustrating since there are so many moving parts outside of our control. Just curious what device are you testing with? (I'm on a Pixel 4a)

@wallismith
Copy link

@mportune-bw I'm on a Pixel 3 using Gboard.

@bingoxo
Copy link

bingoxo commented Dec 29, 2020

Does this work with OpenBoard ,FlorisBoard ,AnySoftKeyboard or any other FOSS keyboard ?

@shivramg94
Copy link

@bingoxo I could only see it working on Gboard and Samsung keyboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants