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

Commit 6159c934 authored by Thomas Stuart's avatar Thomas Stuart
Browse files

fix NPE in CSW#oCC when the ServiceInterface is cleared out

A crash cluster revealed a race condition that causes an NPE on CF
devices. Although this is not repro on local devices, a fix should
be merged.

Fixes: 364811868
Test: build + ran the failing test
Flag: com.android.server.telecom.flags.csw_service_interface_is_null
Change-Id: I05f5a767c47e43f163335dc87a78ea883a55f277
parent 7c417153
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -8,3 +8,14 @@ flag {
  description: "Ensure that the associatedCallCount of CS and RCS is accurately being tracked."
  bug: "286154316"
}

# OWNER=tjstuart TARGET=24Q4
flag {
  name: "csw_service_interface_is_null"
  namespace: "telecom"
  description: "fix potential NPE in onCreateConnection when the ServiceInterface is cleared out"
  bug: "364811868"
    metadata {
        purpose: PURPOSE_BUGFIX
      }
}
 No newline at end of file
+13 −8
Original line number Diff line number Diff line
@@ -1712,6 +1712,11 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                        .setRttPipeToInCall(call.getCsToInCallRttPipeForCs())
                        .build();
                try {
                    if (mFlags.cswServiceInterfaceIsNull() && mServiceInterface == null) {
                        mPendingResponses.remove(callId).handleCreateConnectionFailure(
                                new DisconnectCause(DisconnectCause.ERROR,
                                        "CSW#oCC ServiceInterface is null"));
                    } else {
                        mServiceInterface.createConnection(
                                call.getConnectionManagerPhoneAccount(),
                                callId,
@@ -1719,7 +1724,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                                call.shouldAttachToExistingConnection(),
                                call.isUnknown(),
                                Log.getExternalSession(TELECOM_ABBREVIATION));

                    }
                } catch (RemoteException e) {
                    Log.e(this, e, "Failure to createConnection -- %s", getComponentName());
                    mPendingResponses.remove(callId).handleCreateConnectionFailure(