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

Commit d9c6debd authored by Daniel Banta's avatar Daniel Banta Committed by Android (Google) Code Review
Browse files

Merge "Add DomainSelectionController for the domain selection service"

parents a6574642 bc80e877
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.os.Message;
import android.os.WorkSource;
import android.telephony.AccessNetworkConstants;
import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.BarringInfo;
import android.telephony.CarrierRestrictionRules;
import android.telephony.ClientRequestStats;
import android.telephony.DomainSelectionService;
@@ -2643,6 +2644,15 @@ public interface CommandsInterface {
     */
    default void getBarringInfo(Message result) {};

    /**
     * Returns the last barring information received.
     *
     * @return the last barring information.
     */
    default @Nullable BarringInfo getLastBarringInfo() {
        return null;
    };

    /**
     * Allocates a pdu session id
     *
+24 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.telephony.AccessNetworkConstants.TransportType;
import android.telephony.Annotation.DataActivityType;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.BarringInfo;
@@ -228,6 +229,8 @@ public class GsmCdmaPhone extends Phone {
    private final RegistrantList mVolteSilentRedialRegistrants = new RegistrantList();
    private DialArgs mDialArgs = null;

    private final RegistrantList mEmergencyDomainSelectedRegistrants = new RegistrantList();

    private String mImei;
    private String mImeiSv;
    private String mVmNumber;
@@ -4535,6 +4538,27 @@ public class GsmCdmaPhone extends Phone {
        mVolteSilentRedialRegistrants.notifyRegistrants(ar);
    }

    /** {@inheritDoc} */
    @Override
    public void registerForEmergencyDomainSelected(
            @NonNull Handler h, int what, @Nullable Object obj) {
        mEmergencyDomainSelectedRegistrants.addUnique(h, what, obj);
    }

    /** {@inheritDoc} */
    @Override
    public void unregisterForEmergencyDomainSelected(@NonNull Handler h) {
        mEmergencyDomainSelectedRegistrants.remove(h);
    }

    /** {@inheritDoc} */
    @Override
    public void notifyEmergencyDomainSelected(@TransportType int transportType) {
        logd("notifyEmergencyDomainSelected transportType=" + transportType);
        mEmergencyDomainSelectedRegistrants.notifyRegistrants(
                new AsyncResult(null, transportType, null));
    }

    /**
     * Sets the SIM voice message waiting indicator records.
     * @param line GSM Subscriber Profile Number, one-based. Only '1' is supported
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class NetworkIndication extends IRadioNetworkIndication.Stub {
        BarringInfo cbi = new BarringInfo(RILUtils.convertHalCellIdentity(cellIdentity),
                RILUtils.convertHalBarringInfoList(barringInfos));

        mRil.mBarringInfoChangedRegistrants.notifyRegistrants(new AsyncResult(null, cbi, null));
        mRil.notifyBarringInfoChanged(cbi);
    }

    /**
+28 −0
Original line number Diff line number Diff line
@@ -5010,6 +5010,34 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        }
    }

    /**
     * Registers for the domain selected for emergency calls.
     *
     * @param h Handler for notification message.
     * @param what User-defined message code.
     * @param obj User object.
     */
    public void registerForEmergencyDomainSelected(
            @NonNull Handler h, int what, @Nullable Object obj) {
    }

    /**
     * Unregisters for the domain selected for emergency calls.
     *
     * @param h Handler to be removed from the registrant list.
     */
    public void unregisterForEmergencyDomainSelected(@NonNull Handler h) {
    }

    /**
     * Notifies the domain selected.
     *
     * @param transportType The preferred transport type.
     */
    public void notifyEmergencyDomainSelected(
            @AccessNetworkConstants.TransportType int transportType) {
    }

    /**
     * @return Telephony tester instance.
     */
+15 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import android.provider.Settings;
import android.sysprop.TelephonyProperties;
import android.telephony.AccessNetworkConstants;
import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.BarringInfo;
import android.telephony.CarrierRestrictionRules;
import android.telephony.CellInfo;
import android.telephony.CellSignalStrengthCdma;
@@ -269,6 +270,9 @@ public class RIL extends BaseCommands implements CommandsInterface {
    final RilHandler mRilHandler;
    private MockModem mMockModem;

    // The last barring information received
    private BarringInfo mLastBarringInfo = null;

    // Thread-safe HashMap to map from RIL_REQUEST_XXX constant to HalVersion.
    // This is for Radio HAL Fallback Compatibility feature. When a RIL request
    // is received, the HAL method from the mapping HalVersion here (if present),
@@ -6439,6 +6443,17 @@ public class RIL extends BaseCommands implements CommandsInterface {
                new CellSignalStrengthNr());
    }

    void notifyBarringInfoChanged(@NonNull BarringInfo barringInfo) {
        mLastBarringInfo = barringInfo;
        mBarringInfoChangedRegistrants.notifyRegistrants(new AsyncResult(null, barringInfo, null));
    }

    /** {@inheritDoc} */
    @Override
    public @Nullable BarringInfo getLastBarringInfo() {
        return mLastBarringInfo;
    }

    /**
     * Get the HAL version with a specific service.
     *
Loading