Skip security check when account id is unknown.

Doing the check caused:
   IllegalArgumentException: Unknown URI content://com.android.email.provider/account/-1
       at com.android.email.provider.EmailProvider.query(EmailProvider.java:1092)
       at android.content.ContentProvider$Transport.query(ContentProvider.java:163)
       at android.content.ContentResolver.query(ContentResolver.java:245)
       at com.android.email.activity.MessageList.isSecurityHold(MessageList.java:1146)

Bug 2635060

Change-Id: I80e7c00ef2dd74ceae24a88daf43a0681124a9d4
This commit is contained in:
Makoto Onuki 2010-04-27 16:12:20 -07:00
parent 422ceb0efd
commit e333b68c9e

View File

@ -1091,7 +1091,7 @@ public class MessageList extends ListActivity implements OnItemClickListener, On
@Override
protected Long doInBackground(Void... params) {
// Quick check that account is not in security hold
if (isSecurityHold(mAccountId)) {
if (mAccountId != -1 && isSecurityHold(mAccountId)) {
showSecurityActivity = true;
return Long.valueOf(-1);
}
@ -1600,7 +1600,7 @@ public class MessageList extends ListActivity implements OnItemClickListener, On
// How long we want to wait for refreshes (a good starting guess)
// I suspect this could be lowered down to even 1000 or so, but this seems ok for now
private static final long REFRESH_INTERVAL_MS = 2500;
private java.text.DateFormat mDateFormat;
private java.text.DateFormat mTimeFormat;