Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5f1d249 authored by Jason Chiu's avatar Jason Chiu
Browse files

Do not show the redundant RemoveAccountFailureDialog

When the AccountManager's confirm remove dialog is canceled, a redundant
ConfirmRemoveAccountDialog showed up.

- Only show the dialog when a real error reported from AccountManager
- Also change RemoveAccountFailureDialog's title to remove the redundant
  question mark

Fix: 204948166
Test: manual
Change-Id: If712e120938e80e1bf4593fa78a1a2a70684fc2a
parent b5687c46
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import java.io.IOException;
public class RemoveAccountPreferenceController extends AbstractPreferenceController
        implements PreferenceControllerMixin, OnClickListener {

    private static final String TAG = "RemoveAccountPrefController";
    private static final String KEY_REMOVE_ACCOUNT = "remove_account";

    private final MetricsFeatureProvider mMetricsFeatureProvider;
@@ -175,10 +176,11 @@ public class RemoveAccountPreferenceController extends AbstractPreferenceControl
                                | IOException
                                | AuthenticatorException e) {
                            // handled below
                        }
                        if (failed) {
                            Log.w(TAG, "Remove account error: " + e);
                            RemoveAccountFailureDialog.show(getTargetFragment());
                        } else {
                        }
                        Log.i(TAG, "failed: " + failed);
                        if (!failed) {
                            targetActivity.finish();
                        }
                    }, null, mUserHandle);
@@ -210,7 +212,7 @@ public class RemoveAccountPreferenceController extends AbstractPreferenceControl
            final Context context = getActivity();

            return new AlertDialog.Builder(context)
                    .setTitle(R.string.really_remove_account_title)
                    .setTitle(R.string.remove_account_label)
                    .setMessage(R.string.remove_account_failed)
                    .setPositiveButton(android.R.string.ok, null)
                    .create();