Skip to content
Commit 77f85861 authored by Felipe Leme's avatar Felipe Leme
Browse files

Removed afm.notifyValueChanged() optimization.

On Android P, TextView was keeping track of the last mText that was sent to
AutofillManager to avoid calling it again if the value didn't change, as that
would incur on unnecessary IPC calls from AFM to AFMService in the UIThread.

Now on Android Q this optimization is causing the method to not be called when
it should when the mText is a reference to a SpannableStringBuilder, as it's
equals() method now returns true in this case (before it was returning false,
which was a bug: if the reference didn't change, it should return true).

We have 2 options to solve this problem:

1.Fix TextView to keep a String copy of mText.
2.Remove the optimization.

This CL fixes it using #2, for 2 reasons:

1.On Android Q, the AFM calls to AFMS are async, so it's not a jankiness issue
anymore.
2.Making a copy will actually be *worse* for performance, as it would be making
an unnecessary copy for the cases where autofill is disabled.

Test: atest android.autofillservice.cts.DatasetFilteringTest#testFilter_usingKeyboard
Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything
Fixes: 117106046

Change-Id: Ia1c69e2d7a478288f65566e862f4a43e88eca463
parent 45434d2d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment