Pass the conversation and folder objects from widget to app.
No need to re-look up from uri.
Change-Id: I046ca9193517dbb0954e08fb56fbc49aac750d0d
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java
index 5f4aabb..06a6cbd 100644
--- a/src/com/android/mail/ui/AbstractActivityController.java
+++ b/src/com/android/mail/ui/AbstractActivityController.java
@@ -310,14 +310,14 @@
initCustomActionBarView();
final Intent intent = mActivity.getIntent();
if (intent != null && Intent.ACTION_VIEW.equals(intent.getAction())) {
- if (intent.hasExtra(Utils.EXTRA_FOLDER_URI)) {
+ if (intent.hasExtra(Utils.EXTRA_FOLDER)) {
// Open the folder.
LogUtils.d(LOG_TAG, "SHOW THE FOLDER at %s",
- intent.getStringExtra(Utils.EXTRA_FOLDER_URI));
- } else if (intent.hasExtra(Utils.EXTRA_CONVERSATION_URI)) {
+ intent.getParcelableExtra(Utils.EXTRA_FOLDER));
+ } else if (intent.hasExtra(Utils.EXTRA_CONVERSATION)) {
// Open the conversation.
LogUtils.d(LOG_TAG, "SHOW THE CONVERSATION at %s",
- intent.getStringExtra(Utils.EXTRA_CONVERSATION_URI));
+ intent.getParcelableExtra(Utils.EXTRA_CONVERSATION));
}
}
// Get a Loader to the Account
diff --git a/src/com/android/mail/utils/Utils.java b/src/com/android/mail/utils/Utils.java
index f35bd20..5dc4043 100644
--- a/src/com/android/mail/utils/Utils.java
+++ b/src/com/android/mail/utils/Utils.java
@@ -69,8 +69,8 @@
public static final String EXTRA_ACCOUNT = "account";
public static final String EXTRA_COMPOSE_URI = "composeUri";
- public static final String EXTRA_CONVERSATION_URI = "conversationUri";
- public static final String EXTRA_FOLDER_URI = "folderUri";
+ public static final String EXTRA_CONVERSATION = "conversationUri";
+ public static final String EXTRA_FOLDER = "folder";
/*
* Notifies that changes happened. Certain UI components, e.g., widgets, can
* register for this {@link Intent} and update accordingly. However, this
@@ -571,7 +571,7 @@
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.setDataAndType(conversation.uri, "application/mail-ls");
- intent.putExtra(Utils.EXTRA_CONVERSATION_URI, conversation.uri);
+ intent.putExtra(Utils.EXTRA_CONVERSATION, conversation);
return intent;
}
@@ -584,7 +584,7 @@
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.setDataAndType(folder.uri, "application/mail-ls");
- intent.putExtra(Utils.EXTRA_FOLDER_URI, folder.uri);
+ intent.putExtra(Utils.EXTRA_FOLDER, folder);
return intent;
}