diff --git a/core/api/system-current.txt b/core/api/system-current.txt index a56b39675c369..e117f576b91ec 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -10836,6 +10836,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 getSystemSelectionChannels(); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public java.util.List getTelephonyHistograms(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.UiccSlotInfo[] getUiccSlotsInfo(); method @Nullable public android.os.Bundle getVisualVoicemailSettings(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 683f200c1a356..aaacb438d25a0 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -123,7 +123,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.UUID; import java.util.concurrent.Executor; import java.util.function.Consumer; @@ -13214,6 +13213,37 @@ public class TelephonyManager { } } + /** + * Get which bands the modem's background scan is acting on, specified by + * {@link #setSystemSelectionChannels}. + * + *

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 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. * diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 0bd485139331f..3e7defbbd5bdd 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -2154,6 +2154,8 @@ interface ITelephony { oneway void setSystemSelectionChannels(in List specifiers, int subId, IBooleanConsumer resultCallback); + List getSystemSelectionChannels(int subId); + boolean isMvnoMatched(int subId, int mvnoType, String mvnoMatchData); /** diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 9d4072f1cf1cb..a2361a7d34a17 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -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;