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
Loading
Please register or sign in to comment