Connect "folder settings"

Bug: 6232266
Change-Id: I65f5e07c14bd4c312dbaea107cdc8404e74efe61
This commit is contained in:
Paul Westbrook 2012-03-28 13:31:13 -07:00
parent cd58dfcd8f
commit d1f8cf8710

View File

@ -48,6 +48,9 @@ import com.android.emailcommon.provider.EmailContent.AccountColumns;
import com.android.emailcommon.utility.IntentUtilities; import com.android.emailcommon.utility.IntentUtilities;
import com.android.emailcommon.utility.Utility; import com.android.emailcommon.utility.Utility;
import com.android.mail.providers.Folder;
import com.android.mail.providers.UIProvider.EditSettingsExtras;
import java.util.List; import java.util.List;
/** /**
@ -159,7 +162,7 @@ public class AccountSettings extends PreferenceActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ActivityHelper.debugSetWindowFlags(this); ActivityHelper.debugSetWindowFlags(this);
Intent i = getIntent(); final Intent i = getIntent();
if (savedInstanceState == null) { if (savedInstanceState == null) {
// If we are not restarting from a previous instance, we need to // If we are not restarting from a previous instance, we need to
// figure out the initial prefs to show. (Otherwise, we want to // figure out the initial prefs to show. (Otherwise, we want to
@ -169,6 +172,9 @@ public class AccountSettings extends PreferenceActivity {
mGetAccountIdFromAccountTask = mGetAccountIdFromAccountTask =
(GetAccountIdFromAccountTask) new GetAccountIdFromAccountTask() (GetAccountIdFromAccountTask) new GetAccountIdFromAccountTask()
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, i); .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, i);
} else if (i.hasExtra(EditSettingsExtras.EXTRA_FOLDER)) {
launchMailboxSettings(i);
return;
} else { } else {
// Otherwise, we're called from within the Email app and look for our extras // Otherwise, we're called from within the Email app and look for our extras
mRequestedAccountId = IntentUtilities.getAccountIdFromIntent(i); mRequestedAccountId = IntentUtilities.getAccountIdFromIntent(i);
@ -302,6 +308,23 @@ public class AccountSettings extends PreferenceActivity {
super.onBackPressed(); super.onBackPressed();
} }
private void launchMailboxSettings(Intent intent) {
final Folder folder =
(Folder)intent.getParcelableExtra(EditSettingsExtras.EXTRA_FOLDER);
final com.android.mail.providers.Account account = (com.android.mail.providers.Account)
intent.getParcelableExtra(EditSettingsExtras.EXTRA_ACCOUNT);
// TODO: determine from the account if we should navigate to the mailbox settings.
// See bug 6242668
// Get the mailbox id from the folder
final long mailboxId = Long.parseLong(folder.uri.getPathSegments().get(1));
MailboxSettings.start(this, mailboxId);
finish();
}
private void enableDebugMenu() { private void enableDebugMenu() {
mShowDebugMenu = true; mShowDebugMenu = true;
invalidateHeaders(); invalidateHeaders();