From 281c6365fb95037ca284dd8c910538639e8b3dcb Mon Sep 17 00:00:00 2001 From: Scott Kennedy Date: Thu, 11 Jul 2013 13:24:59 -0700 Subject: [PATCH] Add a new FolderUri This will allow us to add query parameters such that Uris will still appear to be equal, regardless of differences in the parameters. Bug: 9780067 Change-Id: I483d009fe3681ec3d4323b3ca95dff8ca9f4ffde --- src/com/android/email/activity/setup/AccountSettings.java | 3 ++- src/com/android/email/provider/EmailProvider.java | 2 +- src/com/android/email/provider/FolderPickerActivity.java | 2 +- src/com/android/email/provider/WidgetProvider.java | 6 +++--- src/com/android/email2/ui/MailActivityEmail.java | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/com/android/email/activity/setup/AccountSettings.java b/src/com/android/email/activity/setup/AccountSettings.java index fbea8586c..29f7c0e27 100644 --- a/src/com/android/email/activity/setup/AccountSettings.java +++ b/src/com/android/email/activity/setup/AccountSettings.java @@ -357,7 +357,8 @@ public class AccountSettings extends PreferenceActivity implements FeedbackEnabl // See bug 6242668 // Get the mailbox id from the folder - final long mailboxId = Long.parseLong(folder.uri.getPathSegments().get(1)); + final long mailboxId = + Long.parseLong(folder.folderUri.fullUri.getPathSegments().get(1)); MailboxSettings.start(this, mailboxId); finish(); diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index e48c8687d..301742471 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -3986,7 +3986,7 @@ public class EmailProvider extends ContentProvider { message.mId); } else { final Folder f = flist.folders.get(0); - final Uri uri = f.uri; + final Uri uri = f.folderUri.fullUri; final Long mailboxId = Long.parseLong(uri.getLastPathSegment()); putIntegerLongOrBoolean(ourValues, MessageColumns.MAILBOX_KEY, mailboxId); } diff --git a/src/com/android/email/provider/FolderPickerActivity.java b/src/com/android/email/provider/FolderPickerActivity.java index 8fd590761..f45ce3bfd 100644 --- a/src/com/android/email/provider/FolderPickerActivity.java +++ b/src/com/android/email/provider/FolderPickerActivity.java @@ -180,7 +180,7 @@ public class FolderPickerActivity extends Activity implements FolderPickerCallba @Override public void select(Folder folder) { - String folderId = folder.uri.getLastPathSegment(); + String folderId = folder.folderUri.fullUri.getLastPathSegment(); Long id = Long.parseLong(folderId); ContentValues values = new ContentValues(); diff --git a/src/com/android/email/provider/WidgetProvider.java b/src/com/android/email/provider/WidgetProvider.java index 1d8afdae0..e253de0c7 100644 --- a/src/com/android/email/provider/WidgetProvider.java +++ b/src/com/android/email/provider/WidgetProvider.java @@ -107,10 +107,10 @@ public class WidgetProvider extends BaseWidgetProvider { if (uiAccount != null && uiFolder != null) { WidgetService.saveWidgetInformation(context, widgetId, uiAccount, - uiFolder.uri.toString()); + uiFolder.folderUri.fullUri.toString()); - updateWidgetInternal(context, widgetId, uiAccount, uiFolder.type, uiFolder.uri, - uiFolder.conversationListUri, uiFolder.name); + updateWidgetInternal(context, widgetId, uiAccount, uiFolder.type, + uiFolder.folderUri.fullUri, uiFolder.conversationListUri, uiFolder.name); // Now remove the old legacy preference value editor.remove(LEGACY_ACCOUNT_ID_PREFIX + widgetId); diff --git a/src/com/android/email2/ui/MailActivityEmail.java b/src/com/android/email2/ui/MailActivityEmail.java index 07dba5054..107528c54 100644 --- a/src/com/android/email2/ui/MailActivityEmail.java +++ b/src/com/android/email2/ui/MailActivityEmail.java @@ -321,6 +321,6 @@ public class MailActivityEmail extends com.android.mail.ui.MailActivity { folderCursor.close(); } - return Utils.createViewFolderIntent(this, folder.uri, account); + return Utils.createViewFolderIntent(this, folder.folderUri.fullUri, account); } }