DO NOT MERGE ANYWHERE - Clear preferences when package is removed.

(cherry pick of commits 2154caf2f80fa87df84813b8e344f85094a454fd and
da1fc0a9c23697cc255efdccc47862bd1277da3f).

Change-Id: I5a019d771da6ff52ea36ee683a44405f6ea24853
Fixes: 30900628
Fixes: 28722556
(cherry picked from commit 20488d97cdc9aa7e98f6fd75c2890ba18781654a)
2 files changed