Closed Bug 1577003 Opened 2 years ago Closed 2 years ago

Avoid `ViewStructure` in `GeckoSession` autofill methods


(GeckoView :: General, enhancement, P1)



(firefox69 wontfix, firefox70 wontfix, firefox71 fixed)

Tracking Status
firefox69 --- wontfix
firefox70 --- wontfix
firefox71 --- fixed


(Reporter: snorp, Assigned: snorp)



(Whiteboard: [geckoview:m1910])


(5 files)

Fenix would like to add in-app autofill using the same methods we have for implementing Android Autofill. They would additionally like that to work on devices with API >= 21. The ViewStructure class is only in 23+, so we need to have our own version of that for SessionTextInput and TextInputDelegate interfaces. The GeckoView class would of course still need to use ViewStructure for Android Autofill, so this new thing needs to easily convert to a ViewStructure for that case.

We need this to make GeckoSession autofill API available to API levels 21-25. Fenix should act as an autofill service.

Priority: -- → P2
Whiteboard: [geckoview:fenix:m8]

Emily suggests login autofill be a top priority for October ([geckoview:m1910]).

Whiteboard: [geckoview:fenix:m8] → [geckoview:m1910]
Whiteboard: [geckoview:m1910]
Whiteboard: [geckoview:m1910]

This also moves autofill() and provideAutofillVirtualStructure()
into GeckoSession.

This is an alternative to GeckoSession.provideAutofillVirtualStructure()
that does not rely on the ViewStructure class. This is necessary to
support autofill functionality on older devices or without involving
the Android autofill service.

This patch also moves the existing autofill tests into
AutofillDelegateTest.kt and converts them to use this new API
instead of the ViewStructure one. This allows us to test on devices
lower than SDK 26 (which includes automation). In addition to the API
changes, some tests also needed some greening up.

This also adds GeckoView.setAutofillEnabled(), which is enabled by
default. Apps can disable this if they don't want to use the Android
autofill service. This will allow them to set their own
AutofillDelegate on the GeckoSession and provide their own
autofill implementation.

Duplicate of this bug: 1577018
Duplicate of this bug: 1577019

James is working on autofill in October.

Assignee: nobody → snorp
Priority: P2 → P1
Pushed by
Move autofill stuff from TextInputDelegate into AutofillDelegate r=geckoview-reviewers,agi,esawin
Add `GeckoSession.getAutofillElements()` r=geckoview-reviewers,esawin,agi
Handle Android autofill service in GeckoView class r=geckoview-reviewers,esawin
Make naming consistent in GeckoView autofill bits r=geckoview-reviewers,agi,esawin
Update and API description r=geckoview-reviewers,esawin
You need to log in before you can comment on or make changes to this bug.