diff --git a/src/com/android/email/activity/setup/AccountSettings.java b/src/com/android/email/activity/setup/AccountSettings.java index a1f94f017..00e4386e2 100644 --- a/src/com/android/email/activity/setup/AccountSettings.java +++ b/src/com/android/email/activity/setup/AccountSettings.java @@ -32,6 +32,7 @@ import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceActivity; +import android.text.TextUtils; import android.text.SpannableString; import android.text.method.LinkMovementMethod; import android.text.util.Linkify; @@ -339,6 +340,13 @@ public class AccountSettings extends PreferenceActivity implements FeedbackEnabl return true; } + public boolean isValidFragment(String fragmentName) { + // We need to make sure that a fragment about to be attached is valid. This corrects + // a security vulnerability. + return (TextUtils.equals(AccountSettingsFragment.class.getName(), fragmentName) || + super.isValidFragment(fragmentName)); + } + @Override public Intent onBuildStartFragmentIntent(String fragmentName, Bundle args, int titleRes, int shortTitleRes) {