From d07cb4ba4e2ee3022ffc9352eefb6c0f38ddf09b Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Fri, 2 Jul 2010 15:19:25 -0700 Subject: [PATCH] Fix refresh issue w/ mSecurityFlags preference stored as an int Bug: 2803604 Change-Id: I150ca8b5049e6aec022819eb768caa1e3c3ce183 --- src/com/android/email/Account.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/Account.java b/src/com/android/email/Account.java index 965515698..4f205706f 100644 --- a/src/com/android/email/Account.java +++ b/src/com/android/email/Account.java @@ -177,7 +177,13 @@ public class Account { mBackupFlags = preferences.mSharedPreferences.getInt(mUuid + KEY_BACKUP_FLAGS, 0); mProtocolVersion = preferences.mSharedPreferences.getString(mUuid + KEY_PROTOCOL_VERSION, null); - mSecurityFlags = preferences.mSharedPreferences.getLong(mUuid + KEY_SECURITY_FLAGS, 0); + // Wrap this in a try/catch, as this preference was formerly saved as an int (the value no + // longer fits in an int, and is now stored as a long) + try { + mSecurityFlags = preferences.mSharedPreferences.getLong(mUuid + KEY_SECURITY_FLAGS, 0); + } catch (ClassCastException e) { + mSecurityFlags = preferences.mSharedPreferences.getInt(mUuid + KEY_SECURITY_FLAGS, 0); + } mSignature = preferences.mSharedPreferences.getString(mUuid + KEY_SIGNATURE, null); }