summaryrefslogtreecommitdiff
path: root/telephony/java
diff options
context:
space:
mode:
authorSarah Chin <sarahchin@google.com>2020-11-18 13:38:04 -0800
committerSarah Chin <sarahchin@google.com>2020-11-30 14:45:27 -0800
commitf06ca9903c6bcef9f1999485cdbd3ea71a3878e4 (patch)
tree07ec4c3dddda65f4788168d782990dee10a7d097 /telephony/java
parent05eb0982990a1a18cb31aa769da962380b9a8618 (diff)
Create getSystemSelectionChannel API
Test: atest TelephonyManagerTest Bug: 152813408 Change-Id: I2d80284b92414f403af977cbe193766eac08a6e0 Merged-In: I2d80284b92414f403af977cbe193766eac08a6e0
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java31
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl2
-rw-r--r--telephony/java/com/android/internal/telephony/RILConstants.java1
3 files changed, 34 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 44aa6bcde0fa..d156907af081 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -13030,6 +13030,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.
*
* @param mccmnc the carrier's mccmnc that you want to match
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 4895fffa5849..a5619d389c6b 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<RadioAccessSpecifier> specifiers,
int subId, IBooleanConsumer resultCallback);
+ List<RadioAccessSpecifier> 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 9d4072f1cf1c..a2361a7d34a1 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;