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

Change-Id: I2fff3192802f8a180330fda66388eda394334a5a
Merge "Factor out preference-in-storage check to overridable method." into cm-10.2