diff --git a/emailcommon/src/com/android/emailcommon/service/ServiceProxy.java b/emailcommon/src/com/android/emailcommon/service/ServiceProxy.java
index 3a83f9c0b..2cdc2d0ae 100644
--- a/emailcommon/src/com/android/emailcommon/service/ServiceProxy.java
+++ b/emailcommon/src/com/android/emailcommon/service/ServiceProxy.java
@@ -27,6 +27,7 @@ import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteException;
+import com.android.emailcommon.provider.EmailContent;
import com.android.mail.utils.LogUtils;
/**
@@ -59,24 +60,9 @@ public abstract class ServiceProxy {
private boolean mTaskCompleted = false;
public static Intent getIntentForEmailPackage(Context context, String actionName) {
- return new Intent(getIntentStringForEmailPackage(context, actionName));
- }
-
- /**
- * Create Intent action based on the Email package name
- * Package com.android.email + ACTION -> com.android.email.ACTION
- * Package com.google.android.email + ACTION -> com.google.android.email.ACTION
- * Package com.android.exchange + ACTION -> com.android.email.ACTION
- * Package com.google.exchange + ACTION -> com.google.android.email.ACTION
- *
- * @param context the caller's context
- * @param actionName the Intent action
- * @return an Intent action based on the package name
- */
- public static String getIntentStringForEmailPackage(Context context, String actionName) {
- String packageName = context.getPackageName();
- int lastDot = packageName.lastIndexOf('.');
- return packageName.substring(0, lastDot + 1) + "email." + actionName;
+ final Intent intent = new Intent(EmailContent.EMAIL_PACKAGE_NAME + "." + actionName);
+ intent.setPackage(EmailContent.EMAIL_PACKAGE_NAME);
+ return intent;
}
/**
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e3d4cfb47..c5dda07c4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -814,6 +814,7 @@
com.android.email.EXCHANGE_INTENT
com.android.exchange
com.android.email.activity.setup.ACCOUNT_MANAGER_ENTRY
+ com.android.email.CREATE_ACCOUNT
com.android.email.provider
imap
imap
diff --git a/src/com/android/email/activity/setup/AccountSettings.java b/src/com/android/email/activity/setup/AccountSettings.java
index 77200531e..ebd0508c0 100644
--- a/src/com/android/email/activity/setup/AccountSettings.java
+++ b/src/com/android/email/activity/setup/AccountSettings.java
@@ -46,7 +46,6 @@ import com.android.email.provider.EmailProvider;
import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.EmailContent.AccountColumns;
-import com.android.emailcommon.service.ServiceProxy;
import com.android.emailcommon.utility.IntentUtilities;
import com.android.emailcommon.utility.Utility;
import com.android.mail.providers.Folder;
@@ -90,7 +89,7 @@ public class AccountSettings extends PreferenceActivity implements FeedbackEnabl
// Intent extras for launch directly from system account manager
// NOTE: This string must match the one in res/xml/account_preferences.xml
- private static String ACTION_ACCOUNT_MANAGER_ENTRY;
+ private static String INTENT_ACCOUNT_MANAGER_ENTRY;
// NOTE: This constant should eventually be defined in android.accounts.Constants
private static final String EXTRA_ACCOUNT_MANAGER_ACCOUNT = "account";
@@ -199,12 +198,10 @@ public class AccountSettings extends PreferenceActivity implements FeedbackEnabl
// If we are not restarting from a previous instance, we need to
// figure out the initial prefs to show. (Otherwise, we want to
// continue showing whatever the user last selected.)
- if (ACTION_ACCOUNT_MANAGER_ENTRY == null) {
- ACTION_ACCOUNT_MANAGER_ENTRY =
- ServiceProxy.getIntentStringForEmailPackage(this,
- getString(R.string.intent_account_manager_entry));
+ if (INTENT_ACCOUNT_MANAGER_ENTRY == null) {
+ INTENT_ACCOUNT_MANAGER_ENTRY = getString(R.string.intent_account_manager_entry);
}
- if (ACTION_ACCOUNT_MANAGER_ENTRY.equals(i.getAction())) {
+ if (INTENT_ACCOUNT_MANAGER_ENTRY.equals(i.getAction())) {
// This case occurs if we're changing account settings from Settings -> Accounts
mGetAccountIdFromAccountTask =
(GetAccountIdFromAccountTask) new GetAccountIdFromAccountTask()
diff --git a/src/com/android/email/activity/setup/AccountSetupBasics.java b/src/com/android/email/activity/setup/AccountSetupBasics.java
index f834ec6a4..254f0d1ba 100644
--- a/src/com/android/email/activity/setup/AccountSetupBasics.java
+++ b/src/com/android/email/activity/setup/AccountSetupBasics.java
@@ -54,7 +54,6 @@ import com.android.emailcommon.VendorPolicyLoader.Provider;
import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.EmailContent;
import com.android.emailcommon.provider.HostAuth;
-import com.android.emailcommon.service.ServiceProxy;
import com.android.emailcommon.utility.Utility;
import com.android.mail.utils.LogUtils;
@@ -71,7 +70,7 @@ import java.net.URISyntaxException;
* AccountSetupAccountType activity where the user can begin to manually configure the account.
*
* === Support for automated testing ==
- * This activity can also be launched directly via ACTION_CREATE_ACCOUNT. This is intended
+ * This activity can also be launched directly via INTENT_CREATE_ACCOUNT. This is intended
* only for use by continuous test systems, and is currently only available when
* {@link ActivityManager#isRunningInTestHarness()} is set. To use this mode, you must construct
* an intent which contains all necessary information to create the account. No connection
@@ -97,7 +96,7 @@ public class AccountSetupBasics extends AccountSetupActivity
* Direct access for forcing account creation
* For use by continuous automated test system (e.g. in conjunction with monkey tests)
*/
- private static final String ACTION_CREATE_ACCOUNT = "com.android.email.CREATE_ACCOUNT";
+ private static String INTENT_CREATE_ACCOUNT;
private static final String EXTRA_FLOW_MODE = "FLOW_MODE";
private static final String EXTRA_FLOW_ACCOUNT_TYPE = "FLOW_ACCOUNT_TYPE";
private static final String EXTRA_CREATE_ACCOUNT_EMAIL = "EMAIL";
@@ -194,8 +193,10 @@ public class AccountSetupBasics extends AccountSetupActivity
final Intent intent = getIntent();
final String action = intent.getAction();
- if (ServiceProxy.getIntentStringForEmailPackage(
- this, ACTION_CREATE_ACCOUNT).equals(action)) {
+ if (INTENT_CREATE_ACCOUNT == null) {
+ INTENT_CREATE_ACCOUNT = getString(R.string.intent_create_account);
+ }
+ if (INTENT_CREATE_ACCOUNT.equals(action)) {
mSetupData = new SetupData(SetupData.FLOW_MODE_FORCE_CREATE);
} else {
final int intentFlowMode =