kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix bad preference class setting.
rodzic
b41989de03
commit
53e1da0f43
|
@ -69,7 +69,7 @@ class NotificationsSettingsViewModel(private val sharedPreferences: SharedPrefer
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setMessageNotificationPriority(priority: Int) {
|
fun setMessageNotificationPriority(priority: Int) {
|
||||||
sharedPreferences.edit().putInt(TextSecurePreferences.NOTIFICATION_PRIORITY_PREF, priority).apply()
|
sharedPreferences.edit().putString(TextSecurePreferences.NOTIFICATION_PRIORITY_PREF, priority.toString()).apply()
|
||||||
store.update { getState() }
|
store.update { getState() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -501,7 +501,11 @@ public class TextSecurePreferences {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getNotificationPriority(Context context) {
|
public static int getNotificationPriority(Context context) {
|
||||||
return Integer.valueOf(getStringPreference(context, NOTIFICATION_PRIORITY_PREF, String.valueOf(NotificationCompat.PRIORITY_HIGH)));
|
try {
|
||||||
|
return Integer.parseInt(getStringPreference(context, NOTIFICATION_PRIORITY_PREF, String.valueOf(NotificationCompat.PRIORITY_HIGH)));
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
return getIntegerPreference(context, NOTIFICATION_PRIORITY_PREF, NotificationCompat.PRIORITY_HIGH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Ładowanie…
Reference in New Issue