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

Commit f06ca990 authored by Sarah Chin's avatar Sarah Chin
Browse files

Create getSystemSelectionChannel API

Test: atest TelephonyManagerTest
Bug: 152813408
Change-Id: I2d80284b92414f403af977cbe193766eac08a6e0
Merged-In: I2d80284b92414f403af977cbe193766eac08a6e0
parent 05eb0982
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10153,6 +10153,7 @@ package android.telephony {
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSimCardState(int);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Locale getSimLocale();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getSupportedRadioAccessFamily();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.telephony.RadioAccessSpecifier> getSystemSelectionChannels();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public java.util.List<android.telephony.TelephonyHistogram> getTelephonyHistograms();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.UiccSlotInfo[] getUiccSlotsInfo();
    method @Nullable public android.os.Bundle getVisualVoicemailSettings();
+31 −0
Original line number Diff line number Diff line
@@ -13029,6 +13029,37 @@ public class TelephonyManager {
        }
    }
    /**
     * Get which bands the modem's background scan is acting on, specified by
     * {@link #setSystemSelectionChannels}.
     *
     * <p>Requires Permission:
     * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
     * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
     *
     * @return a list of {@link RadioAccessSpecifier}, or an empty list if no bands are specified.
     * @throws IllegalStateException if the Telephony process is not currently available.
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    public @NonNull List<RadioAccessSpecifier> getSystemSelectionChannels() {
        try {
            ITelephony service = getITelephony();
            if (service != null) {
                return service.getSystemSelectionChannels(getSubId());
            } else {
                throw new IllegalStateException("telephony service is null.");
            }
        } catch (RemoteException ex) {
            if (!isSystemProcess()) {
                ex.rethrowAsRuntimeException();
            }
        }
        return new ArrayList<>();
    }
    /**
     * Verifies whether the input MCC/MNC and MVNO correspond to the current carrier.
     *
+2 −0
Original line number Diff line number Diff line
@@ -2154,6 +2154,8 @@ interface ITelephony {
    oneway void setSystemSelectionChannels(in List<RadioAccessSpecifier> specifiers,
            int subId, IBooleanConsumer resultCallback);

    List<RadioAccessSpecifier> getSystemSelectionChannels(int subId);

    boolean isMvnoMatched(int subId, int mvnoType, String mvnoMatchData);

    /**
+1 −0
Original line number Diff line number Diff line
@@ -519,6 +519,7 @@ public interface RILConstants {
    int RIL_REQUEST_RELEASE_PDU_SESSION_ID = 216;
    int RIL_REQUEST_START_HANDOVER = 217;
    int RIL_REQUEST_CANCEL_HANDOVER = 218;
    int RIL_REQUEST_GET_SYSTEM_SELECTION_CHANNELS = 219;

    /* Responses begin */
    int RIL_RESPONSE_ACKNOWLEDGEMENT = 800;