DC: migrate from shared preferences to database

Change-Id: Icd5af34579f6dbf1238364b628afb40fdce7710b