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

Thanks to CyanogenMod:
https://github.com/CyanogenMod/android_frameworks_base/commit/e262881de4fd813bf876ff0b3f2a476d30a1b74d