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

Commit bf9c7107 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Add AIDL connections for SipDelegateManager

Implement AIDL backing for SipDelegateConnection,
DelegateConnectionStateCallback, and
DelegateConnectionMessageCallback as well as all
Parcelables related to those callbacks.

Implement SipDelegateConnection with an AIDL wrapper
implementation, which trampolines callback events
from the remote process to the local callback interface
as well as wrap the SipDelegateConnection AIDL so the
local process can send messages to the remote SipDelegate.

The next CL will be the ImsService AIDL implementation for
SipTransport/SipDelegate APIs.

Test: atest FrameworksTelephonyTests
Change-Id: Ic48cd0f80058d59362c63cf6381304437a81afe0
parent f034e12b
Loading
Loading
Loading
Loading
+32 −5
Original line number Diff line number Diff line
@@ -22,7 +22,12 @@ import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.content.Context;
import android.telephony.BinderCacheManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyFrameworkInitializer;
import android.telephony.ims.aidl.IImsRcsController;

import com.android.internal.telephony.ITelephony;

/**
 * Provides access to information about Telephony IMS services on the device.
@@ -30,8 +35,6 @@ import android.telephony.SubscriptionManager;
@SystemService(Context.TELEPHONY_IMS_SERVICE)
public class ImsManager {

    private Context mContext;

    /**
     * <p>Broadcast Action: Indicates that a previously allowed IMS operation was rejected by the
     * network due to the network returning a "forbidden" response. This may be due to a
@@ -87,6 +90,14 @@ public class ImsManager {
    public static final String EXTRA_WFC_REGISTRATION_FAILURE_MESSAGE =
            "android.telephony.ims.extra.WFC_REGISTRATION_FAILURE_MESSAGE";

    // Cache Telephony Binder interfaces, one cache per process.
    private static final BinderCacheManager<ITelephony> sTelephonyCache =
            new BinderCacheManager<>(ImsManager::getITelephonyInterface);
    private static final BinderCacheManager<IImsRcsController> sRcsCache =
            new BinderCacheManager<>(ImsManager::getIImsRcsControllerInterface);

    private final Context mContext;

    /**
     * Use {@link Context#getSystemService(String)} to get an instance of this class.
     * @hide
@@ -108,7 +119,7 @@ public class ImsManager {
            throw new IllegalArgumentException("Invalid subscription ID: " + subscriptionId);
        }

        return new ImsRcsManager(mContext, subscriptionId);
        return new ImsRcsManager(mContext, subscriptionId, sRcsCache);
    }

    /**
@@ -124,7 +135,7 @@ public class ImsManager {
            throw new IllegalArgumentException("Invalid subscription ID: " + subscriptionId);
        }

        return new ImsMmTelManager(subscriptionId);
        return new ImsMmTelManager(subscriptionId, sTelephonyCache);
    }

    /**
@@ -146,6 +157,22 @@ public class ImsManager {
            throw new IllegalArgumentException("Invalid subscription ID: " + subscriptionId);
        }

        return new SipDelegateManager(mContext, subscriptionId);
        return new SipDelegateManager(mContext, subscriptionId, sRcsCache);
    }

    private static IImsRcsController getIImsRcsControllerInterface() {
        return IImsRcsController.Stub.asInterface(
                TelephonyFrameworkInitializer
                        .getTelephonyServiceManager()
                        .getTelephonyImsServiceRegisterer()
                        .get());
    }

    private static ITelephony getITelephonyInterface() {
        return ITelephony.Stub.asInterface(
                TelephonyFrameworkInitializer
                        .getTelephonyServiceManager()
                        .getTelephonyServiceRegisterer()
                        .get());
    }
}
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telephony.ims;

parcelable DelegateRegistrationState;
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telephony.ims;

parcelable DelegateRequest;
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telephony.ims;

parcelable FeatureTagState;
+11 −3
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.os.Binder;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.telephony.AccessNetworkConstants;
import android.telephony.BinderCacheManager;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyFrameworkInitializer;
@@ -213,6 +214,7 @@ public class ImsMmTelManager implements RegistrationManager {
    }

    private final int mSubId;
    private final BinderCacheManager<ITelephony> mBinderCache;

    /**
     * Create an instance of {@link ImsMmTelManager} for the subscription id specified.
@@ -242,7 +244,8 @@ public class ImsMmTelManager implements RegistrationManager {
            throw new IllegalArgumentException("Invalid subscription ID");
        }

        return new ImsMmTelManager(subId);
        return new ImsMmTelManager(subId, new BinderCacheManager<>(
                ImsMmTelManager::getITelephonyInterface));
    }

    /**
@@ -250,8 +253,9 @@ public class ImsMmTelManager implements RegistrationManager {
     * @hide
     */
    @VisibleForTesting
    public ImsMmTelManager(int subId) {
    public ImsMmTelManager(int subId, BinderCacheManager<ITelephony> binderCache) {
        mSubId = subId;
        mBinderCache = binderCache;
    }

    /**
@@ -1367,7 +1371,11 @@ public class ImsMmTelManager implements RegistrationManager {
        }
    }

    private static ITelephony getITelephony() {
    private ITelephony getITelephony() {
        return mBinderCache.getBinder();
    }

    private static ITelephony getITelephonyInterface() {
        ITelephony binder = ITelephony.Stub.asInterface(
                TelephonyFrameworkInitializer
                        .getTelephonyServiceManager()
Loading