1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Upgrade from "keyguardPrivacy" to "notificationHideSubject"

Make sure existing installations aren't reset to the default value when
the new setting can't be found.
This commit is contained in:
cketti 2012-08-02 03:09:26 +02:00
parent 3e6d161c18
commit 592ed3ef38

View File

@ -639,9 +639,15 @@ public class K9 extends Application {
boolean sortAscending = sprefs.getBoolean("sortAscending", Account.DEFAULT_SORT_ASCENDING);
mSortAscending.put(mSortType, sortAscending);
String notificationHideSubject = sprefs.getString("notificationHideSubject",
NotificationHideSubject.NEVER.toString());
sNotificationHideSubject = NotificationHideSubject.valueOf(notificationHideSubject);
String notificationHideSubject = sprefs.getString("notificationHideSubject", null);
if (notificationHideSubject == null) {
// If the "notificationHideSubject" setting couldn't be found, the app was probably
// updated. Look for the old "keyguardPrivacy" setting and map it to the new enum.
sNotificationHideSubject = (sprefs.getBoolean("keyguardPrivacy", false)) ?
NotificationHideSubject.WHEN_LOCKED : NotificationHideSubject.NEVER;
} else {
sNotificationHideSubject = NotificationHideSubject.valueOf(notificationHideSubject);
}
compactLayouts = sprefs.getBoolean("compactLayouts", false);
mAttachmentDefaultPath = sprefs.getString("attachmentdefaultpath", Environment.getExternalStorageDirectory().toString());