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

Commit 1cc05b3a authored by Nathan Harold's avatar Nathan Harold Committed by Android (Google) Code Review
Browse files

Merge changes from topic "barring-info"

* changes:
  Add BARRING_TYPE_UNKNOWN to BarringInfoTest
  Add UnitTest for BarringInfo
  Add CellBarring Indication From HAL
parents 43efe560 f4dd1542
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ public abstract class BaseCommands implements CommandsInterface {
    protected RegistrantList mLceInfoRegistrants = new RegistrantList();
    protected RegistrantList mEmergencyNumberListRegistrants = new RegistrantList();
    protected RegistrantList mUiccApplicationsEnablementRegistrants = new RegistrantList();
    protected RegistrantList mBarringInfoChangedRegistrants = new RegistrantList();

    @UnsupportedAppUsage
    protected Registrant mGsmSmsRegistrant;
@@ -1027,4 +1028,26 @@ public abstract class BaseCommands implements CommandsInterface {
    public void unregisterUiccApplicationEnablementChanged(Handler h) {
        mUiccApplicationsEnablementRegistrants.remove(h);
    }

    /**
     * Registers the handler for RIL_UNSOL_BARRING_INFO_CHANGED events.
     *
     * @param h Handler for notification message.
     * @param what User-defined message code.
     * @param obj User object.
     */
    @Override
    public void registerForBarringInfoChanged(Handler h, int what, Object obj) {
        mBarringInfoChangedRegistrants.addUnique(h, what, obj);
    }

    /**
     * Unregisters the handler for RIL_UNSOL_BARRING_INFO_CHANGED events.
     *
     * @param h Handler for notification message.
     */
    @Override
    public void unregisterForBarringInfoChanged(Handler h) {
        mBarringInfoChangedRegistrants.remove(h);
    }
}
+17 −0
Original line number Diff line number Diff line
@@ -2448,4 +2448,21 @@ public interface CommandsInterface {
    default List<ClientRequestStats> getClientRequestStats() {
        return null;
    }

    /**
     * Registers the handler for RIL_UNSOL_BARRING_INFO_CHANGED events.
     *
     * @param h Handler for notification message.
     * @param what User-defined message code.
     * @param obj User object.
     */
    default void registerForBarringInfoChanged(Handler h, int what, Object obj) {};

    /**
     * Unregisters the handler for RIL_UNSOL_BARRING_INFO_CHANGED events.
     *
     * @param h Handler for notification message.
     */
    default void unregisterForBarringInfoChanged(Handler h) {};

}
+7 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.os.RemoteException;
import android.telephony.Annotation.DataFailureCause;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.Annotation.SrvccState;
import android.telephony.BarringInfo;
import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
@@ -271,6 +272,12 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
                cellIdentity, chosenPlmn, domain, causeCode, additionalCauseCode);
    }

    @Override
    public void notifyBarringInfoChanged(Phone sender, BarringInfo barringInfo) {
        mTelephonyRegistryMgr.notifyBarringInfoChanged(sender.getPhoneId(), sender.getSubId(),
                barringInfo);
    }

    /**
     * Convert the {@link DataActivityState} enum into the TelephonyManager.DATA_* constants for the
     * public API.
+9 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import android.sysprop.TelephonyProperties;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.telephony.AccessNetworkConstants;
import android.telephony.BarringInfo;
import android.telephony.CarrierConfigManager;
import android.telephony.CellIdentity;
import android.telephony.DataFailCause;
@@ -332,6 +333,7 @@ public class GsmCdmaPhone extends Phone {
                null);
        mCi.setOnSuppServiceNotification(this, EVENT_SSN, null);
        mCi.setOnRegistrationFailed(this, EVENT_REGISTRATION_FAILED, null);
        mCi.registerForBarringInfoChanged(this, EVENT_BARRING_INFO_CHANGED, null);

        //GSM
        mCi.setOnUSSD(this, EVENT_USSD, null);
@@ -2765,6 +2767,13 @@ public class GsmCdmaPhone extends Phone {
                        rfe.domain, rfe.causeCode, rfe.additionalCauseCode);
                break;

            case EVENT_BARRING_INFO_CHANGED:
                logd("Event BarringInfoChanged Received");
                ar = (AsyncResult) msg.obj;
                BarringInfo barringInfo = (BarringInfo) ar.result;
                mNotifier.notifyBarringInfoChanged(this, barringInfo);
                break;

            case EVENT_SET_CALL_FORWARD_DONE:
                ar = (AsyncResult)msg.obj;
                IccRecords r = mIccRecords.get();
+2 −1
Original line number Diff line number Diff line
@@ -205,8 +205,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    protected static final int EVENT_GET_UICC_APPS_ENABLEMENT_DONE  = 54;
    protected static final int EVENT_REAPPLY_UICC_APPS_ENABLEMENT_DONE = 55;
    protected static final int EVENT_REGISTRATION_FAILED = 56;
    protected static final int EVENT_BARRING_INFO_CHANGED = 57;

    protected static final int EVENT_LAST = EVENT_REGISTRATION_FAILED;
    protected static final int EVENT_LAST = EVENT_BARRING_INFO_CHANGED;

    // For shared prefs.
    private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_";
Loading