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

Commit ce40498d authored by Felipe Leme's avatar Felipe Leme
Browse files

Fixed when the CompatibilityBridge is attached to an activity.

The AccessibilityManager is a singleton, so we need to update it everytime
an activity is resumed.

Test: manual verification with Chrome (CTS test is an overkill here)
Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything

Fixes: 112690889
Change-Id: If011db203dee96ec511da80f4e49395c0340f482
parent 62283fdd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1383,6 +1383,7 @@ public class Activity extends ContextThemeWrapper
        if (DEBUG_LIFECYCLE) Slog.v(TAG, "onResume " + this);
        getApplication().dispatchActivityResumed(this);
        mActivityTransitionState.onResume(this, isTopOfTask());
        enableAutofillCompatibilityIfNeeded();
        if (mAutoFillResetNeeded) {
            if (!mAutoFillIgnoreFirstResumePause) {
                View focus = getCurrentFocus();
@@ -7159,7 +7160,6 @@ public class Activity extends ContextThemeWrapper
        mWindow.setColorMode(info.colorMode);

        setAutofillCompatibilityEnabled(application.isAutofillCompatibilityEnabled());
        enableAutofillCompatibilityIfNeeded();
    }

    private void enableAutofillCompatibilityIfNeeded() {
+4 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.service.autofill.UserData;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;
import android.util.SparseArray;
import android.view.Choreographer;
import android.view.KeyEvent;
@@ -559,6 +560,9 @@ public final class AutofillManager {
            // different bridge based on which activity is currently focused
            // in the current process. Since compat would be rarely used, just
            // create and register a new instance every time.
            if (sDebug) {
                Slog.d(TAG, "creating CompatibilityBridge for " + mContext);
            }
            mCompatibilityBridge = new CompatibilityBridge();
        }
    }