Refactor common sync adapter code.

Change-Id: I548d4657f31b04f4f944c5e54207523aeeeafe09
4 files changed