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

Commit 68baef8b authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Remove dependencies on old ImsMmtelManager.RegistrationCallback am: 9029b716

am: 75835bbf

Change-Id: I103bf22e42270fb6b44d11387640bc90e8a9af42
parents 3b0ebc27 75835bbf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -262,7 +262,8 @@ public abstract class FeatureConnection {
            // Cache only non-null value for feature status.
            mFeatureStateCached = state;
        }
        Log.i(TAG, "getFeatureState - returning " + ImsFeature.STATE_LOG_MAP.get(state));
        Log.i(TAG + " [" + mSlotId + "]", "getFeatureState - returning "
                + ImsFeature.STATE_LOG_MAP.get(state));
        return state;
    }

+16 −15
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.ims;

import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.Looper;
import android.telephony.ims.feature.ImsFeature;
@@ -73,7 +74,7 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
    protected final String mLogPrefix;

    @VisibleForTesting
    public Listener mListener;
    public Listener<T> mListener;

    // The IMS feature manager which interacts with ImsService
    @VisibleForTesting
@@ -92,7 +93,7 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
        }
    };

    public FeatureConnector(Context context, int phoneId, Listener listener) {
    public FeatureConnector(Context context, int phoneId, Listener<T> listener) {
        mContext = context;
        mPhoneId = phoneId;
        mListener = listener;
@@ -100,7 +101,7 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
        mLogPrefix = "?";
    }

    public FeatureConnector(Context context, int phoneId, Listener listener,
    public FeatureConnector(Context context, int phoneId, Listener<T> listener,
            String logPrefix) {
        mContext = context;
        mPhoneId = phoneId;
@@ -110,7 +111,7 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
    }

    @VisibleForTesting
    public FeatureConnector(Context context, int phoneId, Listener listener,
    public FeatureConnector(Context context, int phoneId, Listener<T> listener,
            Executor executor, String logPrefix) {
        mContext = context;
        mPhoneId = phoneId;
@@ -120,7 +121,7 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
    }

    @VisibleForTesting
    public FeatureConnector(Context context, int phoneId, Listener listener,
    public FeatureConnector(Context context, int phoneId, Listener<T> listener,
            Executor executor, Looper looper) {
        super(looper);
        mContext = context;
@@ -132,16 +133,16 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {

    /**
     * Start the creation of a connection to the underlying ImsService implementation. When the
     * service is connected, {@link FeatureConnector.Listener#connectionReady(T manager)} will be
     * service is connected, {@link FeatureConnector.Listener#connectionReady(Object)} will be
     * called with an active instance.
     *
     * If this device does not support an ImsStack (i.e. doesn't support
     * {@link PackageManager#FEATURE_TELEPHONY_IMS} feature), this method will do nothing.
     */
    public void connect() {
        Log.i(TAG, "connect");
        Log.i(TAG, getLogMessage("connect"));
        if (!isSupported()) {
            Log.i(TAG, "connect: NOT support!");
            Log.i(TAG, getLogMessage("connect: not supported."));
            return;
        }
        mRetryCount = 0;
@@ -160,7 +161,7 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
     * {@link FeatureConnector.Listener#connectionUnavailable()} will be called one last time.
     */
    public void disconnect() {
        Log.i(TAG, "disconnect");
        Log.i(TAG, getLogMessage("disconnect"));
        removeCallbacks(mGetServiceRunnable);
        synchronized (mLock) {
            if (mManager != null) {
@@ -181,8 +182,8 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
    @VisibleForTesting
    public void createImsService() throws ImsException {
        synchronized (mLock) {
            Log.d(TAG, "createImsService");
            mManager = (T) mListener.getFeatureManager();
            Log.d(TAG, getLogMessage("createImsService"));
            mManager = mListener.getFeatureManager();
            // Adding to set, will be safe adding multiple times. If the ImsService is not
            // active yet, this method will throw an ImsException.
            mManager.addNotifyStatusChangedCallbackIfAvailable(mNotifyStatusChangedCallback);
@@ -238,7 +239,7 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
                                    break;
                                }
                                default: {
                                    Log.w(TAG, "Unexpected State!");
                                    Log.w(TAG, getLogMessage("Unexpected State!"));
                                }
                            }
                        } catch (ImsException e) {
@@ -264,7 +265,7 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
            manager = mManager;
        }
        try {
            Log.i(TAG, "notifyReady");
            Log.i(TAG, getLogMessage("notifyReady"));
            mListener.connectionReady(manager);
        }
        catch (ImsException e) {
@@ -278,11 +279,11 @@ public class FeatureConnector<T extends IFeatureConnector> extends Handler {
    }

    protected void notifyNotReady() {
        Log.i(TAG, "notifyNotReady");
        Log.i(TAG, getLogMessage("notifyNotReady"));
        mListener.connectionUnavailable();
    }

    protected String getLogMessage(String message) {
        return "Connector-[" + mLogPrefix + "] " + message;
        return "Connector-[" + mLogPrefix + ", " + mPhoneId + "] " + message;
    }
}
+3 −4
Original line number Diff line number Diff line
@@ -17,9 +17,8 @@
package com.android.ims;

import android.net.Uri;
import android.telephony.ims.ImsMmTelManager;
import android.telephony.ims.RegistrationManager;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;

@@ -29,10 +28,10 @@ import java.util.Arrays;
 * Listener for receiving notifications about changes to the IMS connection.
 * It provides a state of IMS registration between UE and IMS network, the service
 * availability of the local device during IMS registered.
 * @Deprecated Use {@link ImsMmTelManager.RegistrationCallback} instead.
 * @Deprecated Use {@link RegistrationManager.RegistrationCallback} instead.
 * @hide
 */
public class ImsConnectionStateListener extends ImsMmTelManager.RegistrationCallback {
public class ImsConnectionStateListener extends RegistrationManager.RegistrationCallback {

    @Override
    public final void onRegistered(@ImsRegistrationImplBase.ImsRegistrationTech int imsRadioTech) {
+75 −58

File changed.

Preview size limit exceeded, changes collapsed.

+45 −31

File changed.

Preview size limit exceeded, changes collapsed.