Fix preference compat crash

Fixes #7018
// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-10-03 10:24:45 -07:00
parent 2c1337b33e
commit c09d2951b1
3 changed files with 5 additions and 10 deletions

View File

@@ -10,10 +10,9 @@ import android.support.annotation.ArrayRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.SharedPreferencesCompat;
import android.util.Log;
import com.h6ah4i.android.compat.content.SharedPreferenceCompat;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.preferences.widgets.NotificationPrivacyPreference;
@@ -692,9 +691,7 @@ public class TextSecurePreferences {
private static Set<String> getStringSetPreference(Context context, String key, Set<String> defaultValues) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.contains(key)) {
return SharedPreferenceCompat.getStringSet(PreferenceManager.getDefaultSharedPreferences(context),
key,
Collections.<String>emptySet());
return prefs.getStringSet(key, Collections.<String>emptySet());
} else {
return defaultValues;
}