Log preference changes

This change logs preference changes. The code has been adapted from Echo.

Change-Id: I1c1e892b2b97c28fd0271dc8e0435a7a5a6ba824
Merge "Log preference changes"