Accessibility: properly announce checkbox/switch preference changes

If a switch/checkbox preference is clicked it immediately fires an
accessibility event which captures the current state of the view to
which the prefernce is bound. If such a preference is a part of a pref
screen clicking it changes the preference and invalidates the adapter
which requests an async layout during which the correspinding view
will be updated. As a result the click accessibility event and node
infos in the view subtree capture the old state of the preference's
view resulting in an opposite feedback - bad. Now if accessibility is
enabled we immediately sync the view with the preference to ensure
the accessibility state reflects the latests view state.

bug:22596300

Change-Id: Idd6fb1c4143c15b62ce8c53fb118983f583305c0
5 files changed