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

Commit a3396d7e authored by Robert Gross's avatar Robert Gross
Browse files

Incorrect handling of undefined call screening

If registration of call-screening service fails (by default it is not
available), the disconnection of said service is still attempted
throwing an error due to an attempt to unregister a receiver that
doesn't exist.

Test: manual testing
Bug: 189464381

Change-Id: Ib25cb5b0324e95b9cda3e09bf428e11e2b79601e
parent f7abe7bf
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -313,11 +313,14 @@ public class CallScreeningServiceFilter extends CallFilter {

    private void bindCallScreeningService(
            CompletableFuture<CallFilteringResult> resultFuture) {
        mConnection = new CallScreeningServiceConnection(resultFuture);
        CallScreeningServiceConnection connection = new CallScreeningServiceConnection(
                resultFuture);
        if (!CallScreeningServiceHelper.bindCallScreeningService(mContext,
                mCallsManager.getCurrentUserHandle(), mPackageName, mConnection)) {
                mCallsManager.getCurrentUserHandle(), mPackageName, connection)) {
            Log.i(this, "Call screening service binding failed.");
            resultFuture.complete(mPriorStageResult);
        } else {
            mConnection = connection;
        }
    }