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

Commit 620a6ced authored by Felipe Leme's avatar Felipe Leme
Browse files

Only call negative listener when SaveUI is dismissed by tapping button.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 66235266

Change-Id: Ieb3085b64e96ccbd3dd97fca58fcb9d4930c82fa
parent b1b99b02
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -263,9 +263,7 @@ final class SaveUi {
        } else {
            noButton.setText(R.string.autofill_save_no);
        }
        final View.OnClickListener cancelListener =
                (v) -> mListener.onCancel(info.getNegativeActionListener());
        noButton.setOnClickListener(cancelListener);
        noButton.setOnClickListener((v) -> mListener.onCancel(info.getNegativeActionListener()));

        final View yesButton = view.findViewById(R.id.autofill_save_yes);
        yesButton.setOnClickListener((v) -> mListener.onSave());
@@ -273,9 +271,6 @@ final class SaveUi {
        mDialog = new Dialog(context, R.style.Theme_DeviceDefault_Light_Panel);
        mDialog.setContentView(view);

        // Dialog can be dismissed when touched outside.
        mDialog.setOnDismissListener((d) -> mListener.onCancel(info.getNegativeActionListener()));

        final Window window = mDialog.getWindow();
        window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
        window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE