Add support for live update of SharedPreferences

In the previous CL (ag/19395849) we added support for bulk sync where we
synced all the keys when SDK is loaded. Once all the SDKs are loaded,
app can still update their SharedPreferences. We need to propagate
further updates into Sandbox too.

SharedPreferences provides interface to register listeners which are
invoked everytime a key in it is updated. We add our own listener which
syncs the key to Sandbox.

Addtional changes:
  - Made syncData idempotent so that we don't make multiple bulk sync
    or register listener multiple times.
  - Made it a bit more thread safe.

Bug: 239403323
Test: atest SdkSdkSandboxFrameworkUnitTests
Change-Id: I5c149836db537f118f6f810b8850b90edb4605f1
6 files changed
tree: 3c7a4f403e2573e9170938245fd722257f355a54
  1. adservices/
  2. apex/
  3. sdksandbox/
  4. groups
  5. OWNERS
  6. PREUPLOAD.cfg
  7. project.config