Reduce visibility of Util method

This commit is contained in:
Trevor Terris 2021-05-04 11:25:34 -04:00 committed by Daniele Laudani
parent 928519392f
commit 3d8361cc89

View file

@ -24,7 +24,11 @@ public final class DeviceProtectedUtils {
private static Context deviceProtectedContext;
public static Context getContext(final Context context) {
public static SharedPreferences getSharedPreferences(final Context context) {
return PreferenceManager.getDefaultSharedPreferences(getDeviceProtectedContext(context));
}
private static Context getDeviceProtectedContext(final Context context) {
if (deviceProtectedContext != null) {
return deviceProtectedContext;
}
@ -33,10 +37,6 @@ public final class DeviceProtectedUtils {
return deviceProtectedContext;
}
public static SharedPreferences getSharedPreferences(final Context context) {
return PreferenceManager.getDefaultSharedPreferences(getContext(context));
}
private DeviceProtectedUtils() {
// This utility class is not publicly instantiable.
}