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

Commit eeee9520 authored by Joanne Chung's avatar Joanne Chung Committed by Android (Google) Code Review
Browse files

Merge "Fix InlineSuggestionRenderService service connection leakage"

parents d13a6c72 d21d3ddf
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ final class AutofillManagerServiceImpl
            sendStateToClients(/* resetClient= */ false);
        }
        updateRemoteAugmentedAutofillService();
        updateRemoteInlineSuggestionRenderServiceLocked();
        getRemoteInlineSuggestionRenderServiceLocked();

        return enabledChanged;
    }
@@ -685,8 +685,12 @@ final class AutofillManagerServiceImpl

    @GuardedBy("mLock")
    void resetExtServiceLocked() {
        if (sVerbose) Slog.v(TAG, "reset autofill service.");
        if (sVerbose) Slog.v(TAG, "reset autofill service in ExtServices.");
        mFieldClassificationStrategy.reset();
        if (mRemoteInlineSuggestionRenderService != null) {
            mRemoteInlineSuggestionRenderService.destroy();
            mRemoteInlineSuggestionRenderService = null;
        }
    }

    @GuardedBy("mLock")
@@ -1583,18 +1587,6 @@ final class AutofillManagerServiceImpl
        return mFieldClassificationStrategy.getDefaultAlgorithm();
    }

    private void updateRemoteInlineSuggestionRenderServiceLocked() {
        if (mRemoteInlineSuggestionRenderService != null) {
            if (sVerbose) {
                Slog.v(TAG, "updateRemoteInlineSuggestionRenderService(): "
                        + "destroying old remote service");
            }
            mRemoteInlineSuggestionRenderService = null;
        }

        mRemoteInlineSuggestionRenderService = getRemoteInlineSuggestionRenderServiceLocked();
    }

    @Nullable RemoteInlineSuggestionRenderService getRemoteInlineSuggestionRenderServiceLocked() {
        if (mRemoteInlineSuggestionRenderService == null) {
            final ComponentName componentName = RemoteInlineSuggestionRenderService