ThemeManager : Add support for custom densities

This adds support for custom densities. In the case that a density
doesn't fit in the standard buckets, it assumes it to be the closest matching one.

Change-Id: I6bc19b05b0702c7106dd16e427c4bcb0af0825a6