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

Commit 373d49eb authored by Felipe Leme's avatar Felipe Leme
Browse files

Fixed OneTimeListener so AUTOFILL_SAVE_UI metric is properly saved.

Test: adb shell logcat -b events | grep sysui
Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything

Fixes: 112315388

Change-Id: Iecf374578b33a4fcfa84fe4f07613e05c9777fa9
parent deee3950
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -81,6 +81,13 @@ final class SaveUi {
        void onDestroy();
    }

    /**
     * Wrapper that guarantees that only one callback is triggered by ignoring further calls after
     * it's destroyed.
     *
     * <p>It's needed becase {@link #onCancel(IntentSender)} is always called when the Save UI
     * dialog is dismissed.
     */
    private class OneTimeListener implements OnSaveListener {

        private final OnSaveListener mRealListener;
@@ -96,7 +103,6 @@ final class SaveUi {
            if (mDone) {
                return;
            }
            mDone = true;
            mRealListener.onSave();
        }

@@ -106,7 +112,6 @@ final class SaveUi {
            if (mDone) {
                return;
            }
            mDone = true;
            mRealListener.onCancel(listener);
        }