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

Commit 1ca091b7 authored by Felipe Leme's avatar Felipe Leme
Browse files

Fixed how temporary augmented autofill is set.

Test: manual observation on dumpsys and logcat
Test: atest CtsAutoFillServiceTestCases
Bug: 123666298

Change-Id: Iebb377b186a6070a620de2c42c69ff0c52dff81d
parent a6a335de
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ final class AutofillManagerServiceImpl
        mAugmentedAutofillResolver = new FrameworkResourcesServiceNameResolver(master.getContext(),
                com.android.internal.R.string.config_defaultAugmentedAutofillService);
        mAugmentedAutofillResolver.setOnTemporaryServiceNameChangedCallback(
                (u, s) -> updateRemoteAugmentedAutofillService());
                (u, s) -> updateRemoteAugmentedAutofillService(s));

        updateLocked(disabled);
    }
@@ -1048,8 +1048,12 @@ final class AutofillManagerServiceImpl
                    componentName, mUserId, new RemoteAugmentedAutofillServiceCallbacks() {
                        @Override
                        public void onServiceDied(@NonNull RemoteAugmentedAutofillService service) {
                            // TODO(b/123100811): properly implement
                            Slog.w(TAG, "remote augmented autofill service died");
                            final RemoteAugmentedAutofillService remoteService =
                                    mRemoteAugmentedAutofillService;
                            if (remoteService != null) {
                                remoteService.destroy();
                            }
                        }
                    }, mMaster.isInstantServiceAllowed(), mMaster.verbose);
        }
@@ -1060,8 +1064,7 @@ final class AutofillManagerServiceImpl
    /**
     * Called when the {@link #mAugmentedAutofillResolver} changed (among other places).
     */
    private void updateRemoteAugmentedAutofillService() {
        final String serviceName = mAugmentedAutofillResolver.getServiceName(mUserId);
    private void updateRemoteAugmentedAutofillService(@Nullable String serviceName) {
        if (serviceName == null) {
            if (sVerbose) Slog.v(TAG, "updateRemoteAugmentedAutofillService(): time's up!");
            if (mRemoteAugmentedAutofillService != null) {