Factor out preference-in-storage check to overridable method.

Change-Id: I2fff3192802f8a180330fda66388eda394334a5a
Merge "Factor out preference-in-storage check to overridable method." into jellybean-mr2.1