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

Commit 50e41d0d authored by Sailesh Nepal's avatar Sailesh Nepal
Browse files

createConnection fix and misc cleanup

This CL does the following:
  - update ConnectionServiceWrapper to use latest
    ParcelableConnection property names
  - revert part of Ihab's change to CallServiceNotifier to
    get SIM subscriptions working again

Bug: 17156304
Change-Id: I4d6f6829f8d77b928ade3c806c6262cc072d6361
parent d0a8d8be
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -889,10 +889,7 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
        if (connection.getState() == Connection.STATE_DISCONNECTED) {
            // A connection that begins in the DISCONNECTED state is an indication of
            // failure to connect; we handle all failures uniformly
            removeCall(
                    callId,
                    connection.getFailureCode(),
                    connection.getFailureMessage());
            removeCall(callId, connection.getDisconnectCause(), connection.getDisconnectMessage());
        } else {
            // Successful connection
            if (mPendingResponses.containsKey(callId)) {
+11 −8
Original line number Diff line number Diff line
@@ -96,6 +96,8 @@ public class CallServiceNotifier {
        TelecommManager telecommManager =
                (TelecommManager) context.getSystemService(Context.TELECOMM_SERVICE);

        telecommManager.clearAccounts(context.getPackageName());

        telecommManager.registerPhoneAccount(PhoneAccount.builder()
                .withAccountHandle(
                        new PhoneAccountHandle(
@@ -105,21 +107,22 @@ public class CallServiceNotifier {
                .withSubscriptionNumber("555-TEST")
                .withCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER)
                .withIconResId(R.drawable.stat_sys_phone_call)
                .withLabel("Dummy Service")
                .withShortDescription("a short description for the dummy service")
                .withLabel("TelecommTestApp Call Provider")
                .withShortDescription("a short description for the call provider")
                .build());

        telecommManager.registerPhoneAccount(PhoneAccount.builder()
                .withAccountHandle(
                        new PhoneAccountHandle(
                                new ComponentName(context, TestConnectionManager.class),
                                new ComponentName(context, TestConnectionService.class),
                                SIM_SUBSCRIPTION_ID))
                .withHandle(Uri.parse("tel:555-CMGR"))
                .withSubscriptionNumber("555-CMGR")
                .withCapabilities(PhoneAccount.CAPABILITY_CONNECTION_MANAGER)
                .withHandle(Uri.parse("tel:555-TSIM"))
                .withSubscriptionNumber("555-TSIM")
                .withCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER |
                    PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)
                .withIconResId(R.drawable.stat_sys_phone_call)
                .withLabel("Dummy Connection Manager")
                .withShortDescription("a short description for the dummy connection manager")
                .withLabel("TelecommTestApp SIM Subscription")
                .withShortDescription("a short description for the sim subscription")
                .build());

        telecommManager.registerPhoneAccount(PhoneAccount.builder()
+2 −2
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ public class TestConnectionManager extends ConnectionService {
    }

    private static void log(String msg) {
        Log.w("telecomtestcs", "[TestConnectionService] " + msg);
        Log.w("telecomtestcs", "[TestConnectionManager] " + msg);
    }

    @Override
@@ -200,7 +200,7 @@ public class TestConnectionManager extends ConnectionService {
            PhoneAccountHandle connectionManagerAccount,
            final ConnectionRequest request) {
        return new TestManagedConnection(
                createRemoteOutgoingConnection(
                createRemoteIncomingConnection(
                        request.getAccountHandle(),
                        request),
                true);