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

Commit 38dca4de authored by Brad Ebinger's avatar Brad Ebinger Committed by Automerger Merge Worker
Browse files

Add AIDL connections for SipDelegateManager am: bf9c7107 am: 20734105 am: 449e45b1

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1462844

Change-Id: I05c94822a83537baa11adfe6a373881e5438b7af
parents 5248cd1e 449e45b1
Loading
Loading
Loading
Loading
+32 −5
Original line number Original line Diff line number Diff line
@@ -22,7 +22,12 @@ import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.SystemService;
import android.content.Context;
import android.content.Context;
import android.telephony.BinderCacheManager;
import android.telephony.SubscriptionManager;
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.
 * Provides access to information about Telephony IMS services on the device.
@@ -30,8 +35,6 @@ import android.telephony.SubscriptionManager;
@SystemService(Context.TELEPHONY_IMS_SERVICE)
@SystemService(Context.TELEPHONY_IMS_SERVICE)
public class ImsManager {
public class ImsManager {


    private Context mContext;

    /**
    /**
     * <p>Broadcast Action: Indicates that a previously allowed IMS operation was rejected by the
     * <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
     * 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 =
    public static final String EXTRA_WFC_REGISTRATION_FAILURE_MESSAGE =
            "android.telephony.ims.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.
     * Use {@link Context#getSystemService(String)} to get an instance of this class.
     * @hide
     * @hide
@@ -108,7 +119,7 @@ public class ImsManager {
            throw new IllegalArgumentException("Invalid subscription ID: " + subscriptionId);
            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);
            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);
            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 Original line 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 Original line 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 Original line 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 Original line Diff line number Diff line
@@ -29,6 +29,7 @@ import android.os.Binder;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.os.ServiceSpecificException;
import android.telephony.AccessNetworkConstants;
import android.telephony.AccessNetworkConstants;
import android.telephony.BinderCacheManager;
import android.telephony.CarrierConfigManager;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyFrameworkInitializer;
import android.telephony.TelephonyFrameworkInitializer;
@@ -213,6 +214,7 @@ public class ImsMmTelManager implements RegistrationManager {
    }
    }


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


    /**
    /**
     * Create an instance of {@link ImsMmTelManager} for the subscription id specified.
     * 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");
            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
     * @hide
     */
     */
    @VisibleForTesting
    @VisibleForTesting
    public ImsMmTelManager(int subId) {
    public ImsMmTelManager(int subId, BinderCacheManager<ITelephony> binderCache) {
        mSubId = subId;
        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(
        ITelephony binder = ITelephony.Stub.asInterface(
                TelephonyFrameworkInitializer
                TelephonyFrameworkInitializer
                        .getTelephonyServiceManager()
                        .getTelephonyServiceManager()
Loading