Cache whether accessibility is enabled to avoid repeated remote calls

AccessibilityUtils#isAccessibilityEnabled() is called quite frequently.
Under some conditions, this method makes a remote call to get the list
of all enabled accessibility services, which can be slow. Help reduce
jank by caching whether accessibility is enabled in a static variable
the first time #isAccessibiltyEnabled is called.

This variable is reset when any activity is resumed since the user can
change accessibility settings while not in the application.
ChromeActivity also resets the value when accessibility state changes.


Change-Id: Ie26d8295b183dc7fa8ac61115c75c31f7d524acf
Reviewed-by: Ted Choc <>
Commit-Queue: Theresa <>
Cr-Commit-Position: refs/heads/master@{#631499}
2 files changed