diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/DeviceProtectedUtils.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/DeviceProtectedUtils.java index fad38fdb6..1f531b72b 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/DeviceProtectedUtils.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/DeviceProtectedUtils.java @@ -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. }