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

Commit 72b973ba authored by Daniel Bright's avatar Daniel Bright Committed by Automerger Merge Worker
Browse files

Merge "Make TelephonyManager#setImsRegistrationState multi-sim aware" am:...

Merge "Make TelephonyManager#setImsRegistrationState multi-sim aware" am: 2c8f0de9 am: 7c2815e5 am: f95800d6

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6b71a7d1779a7f8fa47150be0a8f2549188d61df
parents 907c3f16 f95800d6
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -7805,18 +7805,23 @@ public class TelephonyManager {
    }
    /**
     * Set IMS registration state
     * Set IMS registration state on all active subscriptions.
     * <p/>
     * Use {@link android.telephony.ims.stub.ImsRegistrationImplBase#onRegistered} and
     * {@link android.telephony.ims.stub.ImsRegistrationImplBase#onDeregistered} to set Ims
     * registration state instead.
     *
     * @param registered whether ims is registered
     *
     * @param Registration state
     * @hide
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public void setImsRegistrationState(boolean registered) {
    public void setImsRegistrationState(final boolean registered) {
        try {
            ITelephony telephony = getITelephony();
            final ITelephony telephony = getITelephony();
            if (telephony != null)
                telephony.setImsRegistrationState(registered);
        } catch (RemoteException e) {
        } catch (final RemoteException e) {
        }
    }
+17 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.telephony.AccessNetworkConstants;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.ims.aidl.IImsRegistrationCallback;
import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
@@ -114,6 +115,22 @@ public interface RegistrationManager {
                        AccessNetworkConstants.TRANSPORT_TYPE_WLAN);
            }};

    /** @hide */
    @NonNull
    static String registrationStateToString(
            final @NetworkRegistrationInfo.RegistrationState int value) {
        switch (value) {
            case REGISTRATION_STATE_NOT_REGISTERED:
                return "REGISTRATION_STATE_NOT_REGISTERED";
            case REGISTRATION_STATE_REGISTERING:
                return "REGISTRATION_STATE_REGISTERING";
            case REGISTRATION_STATE_REGISTERED:
                return "REGISTRATION_STATE_REGISTERED";
            default:
                return Integer.toString(value);
        }
    }

    /**
     * Callback class for receiving IMS network Registration callback events.
     * @see #registerImsRegistrationCallback(Executor, RegistrationCallback)