From: Svetoslav Ganov Date: Tue, 21 Feb 2017 23:28:20 +0000 (-0800) Subject: Optimize AutoFillManager calls X-Git-Tag: android-x86-8.1-r1~3535^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=acfa5ee00a9a6dd3b23b93e28a881996f76b584a;p=android-x86%2Fframeworks-base.git Optimize AutoFillManager calls AutoFillManager needs to handle calls for value changes and reset only if there was a focus change reported, hence the APIs for value change and reset do not need to connect to the backing service to determine the enabled state. Test: Auto-fill CTS tests pass bug:35641424 Change-Id: I50e449925034c54257e35aa78e066e2a0fa53c03 --- diff --git a/core/java/android/view/autofill/AutoFillManager.java b/core/java/android/view/autofill/AutoFillManager.java index d9003a6fa3bd..2168444b9b58 100644 --- a/core/java/android/view/autofill/AutoFillManager.java +++ b/core/java/android/view/autofill/AutoFillManager.java @@ -179,8 +179,6 @@ public final class AutoFillManager { * @param view view whose focus changed. */ public void valueChanged(View view) { - ensureServiceClientAddedIfNeeded(); - if (!mEnabled || !mHasSession) { return; } @@ -199,8 +197,6 @@ public final class AutoFillManager { * @param value new value of the child. */ public void virtualValueChanged(View parent, int childId, AutoFillValue value) { - ensureServiceClientAddedIfNeeded(); - if (!mEnabled || !mHasSession) { return; } @@ -216,8 +212,6 @@ public final class AutoFillManager { * call this method after the form is submitted and another page is rendered. */ public void reset() { - ensureServiceClientAddedIfNeeded(); - if (!mEnabled && !mHasSession) { return; }