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

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

Added missing calls to onConnected() and onDisconnected().

They got lost in a previous refactoring....

Bug: 35395043
Test: CtsAutoFillServiceTestCases pass
Test: manual verification
Change-Id: I4e70f84185d6708ea0ebfa831c160e859fcf9e5c
parent c3c62b30
Loading
Loading
Loading
Loading
+25 −2
Original line number Diff line number Diff line
@@ -235,9 +235,20 @@ final class RemoteFillService implements DeathRecipient {
        }
        mBinding = false;
        if (isBound()) {
            // TODO(b/33197203, b/35395043): synchronize access instead
            // Need to double check if it's null, since it could be set on onServiceDisconnected()
            if (mAutoFillService != null) {
                try {
                    mAutoFillService.onDisconnected();
                } catch (Exception e) {
                    Slog.w(LOG_TAG, "Exception calling onDisconnected(): " + e);
                }
            }
            if (mAutoFillService != null) {
                mAutoFillService.asBinder().unlinkToDeath(this, 0);
                mAutoFillService = null;
            }
        }
        mContext.unbindService(mServiceConnection);
    }

@@ -305,6 +316,18 @@ final class RemoteFillService implements DeathRecipient {
                return;
            }

            try {
                // TODO(b/33197203, b/35395043): synchronize access instead
                // Need to double check if it's null, since it could be set on
                // onServiceDisconnected()
                if (mAutoFillService != null) {
                    mAutoFillService.onConnected();
                }
            } catch (RemoteException e) {
                Slog.w(LOG_TAG, "Exception calling onConnected(): " + e);
            }


            if (mPendingRequest != null) {
                handlePendingRequest(mPendingRequest);
            }