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

Commit 3e813b42 authored by Felipe Leme's avatar Felipe Leme
Browse files

Reset compat mode settings on settings change.

Test: manual verification
Test: atest CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest

Bug: 73786629

Change-Id: Id77084fe38e75eaedba828d8737e6e465c015400
parent 53f25928
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -524,6 +524,7 @@ public final class AutofillManagerService extends SystemService {

    private void addCompatibilityModeRequestsLocked(@NonNull AutofillManagerServiceImpl service
            , int userId) {
        mAutofillCompatState.reset();
        final ArrayMap<String, Pair<Long, String>> compatPackages =
                service.getCompatibilityPackagesLocked();
        if (compatPackages == null || compatPackages.isEmpty()) {
@@ -626,6 +627,15 @@ public final class AutofillManagerService extends SystemService {
                }
            }
        }

        void reset() {
            synchronized (mLock) {
                if (mUserSpecs != null) {
                    mUserSpecs.clear();
                    mUserSpecs = null;
                }
            }
        }
    }

    final class AutoFillManagerServiceStub extends IAutoFillManager.Stub {
@@ -1045,6 +1055,9 @@ public final class AutofillManagerService extends SystemService {
                    Settings.Secure.AUTOFILL_SERVICE), false, this, UserHandle.USER_ALL);
            resolver.registerContentObserver(Settings.Secure.getUriFor(
                    Settings.Secure.USER_SETUP_COMPLETE), false, this, UserHandle.USER_ALL);
            resolver.registerContentObserver(Settings.Global.getUriFor(
                    Settings.Global.AUTOFILL_COMPAT_ALLOWED_PACKAGES), false, this,
                    UserHandle.USER_ALL);
        }

        @Override