diff options
author | 2018-10-04 18:12:08 +0000 | |
---|---|---|
committer | 2018-10-04 18:12:08 +0000 | |
commit | a7ea740f3ae7a87abbc49f8ac743ff5a82584bb9 (patch) | |
tree | fc4303fcc82bcf59dbfb182bc69e474fb5600329 | |
parent | 3b651e90bc5b9477ec9ea8b81d7b6d8189f0cc7a (diff) | |
parent | 2f2ceb7efde102623c9cc4d198236936180038dc (diff) |
Merge "Add isManualNetworkSelectionAllowed api to telephonyManager"
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 23 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 7 |
2 files changed, 30 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index ea9ac39c8111..80b6ead339d0 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -8381,6 +8381,29 @@ public class TelephonyManager { } /** + * Checks if manual network selection is allowed. + * + * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the + * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}. + * + * @return {@code true} if manual network selection is allowed, otherwise return {@code false}. + * + * @hide + */ + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) + public boolean isManualNetworkSelectionAllowed() { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.isManualNetworkSelectionAllowed(getSubId()); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#isManualNetworkSelectionAllowed", e); + } + return true; + } + + /** * Get the most recently available signal strength information. * * Get the most recent SignalStrength information reported by the modem. Due diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index ca2bcff2f4cd..32eb12b49cf0 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -808,6 +808,13 @@ interface ITelephony { */ boolean isDataEnabled(int subId); + /** + * Checks if manual network selection is allowed. + * + * @return {@code true} if manual network selection is allowed, otherwise return {@code false}. + */ + boolean isManualNetworkSelectionAllowed(int subId); + /** * Get P-CSCF address from PCO after data connection is established or modified. * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN |