Loading telephony/java/android/telephony/TelephonyManager.java +40 −16 Original line number Diff line number Diff line Loading @@ -2862,9 +2862,11 @@ public class TelephonyManager { } /** * Return if the current radio is LTE on CDMA. This * is a tri-state return value as for a period of time * the mode may be unknown. * Return if the current radio is LTE on CDMA. This is a tri-state return value as for a period * of time the mode may be unknown. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE} * or {@link PhoneConstants#LTE_ON_CDMA_TRUE} Loading Loading @@ -5682,6 +5684,9 @@ public class TelephonyManager { /** * Sets the network selection mode to automatic. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). Loading @@ -5704,27 +5709,36 @@ public class TelephonyManager { /** * Perform a radio scan and return the list of available networks. * * The return value is a list of the OperatorInfo of the networks found. Note that this * scan can take a long time (sometimes minutes) to happen. * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * <p> Note that this scan can take a long time (sometimes minutes) to happen. * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier * privileges (see {@link #hasCarrierPrivileges}) * * @return {@link CellNetworkScanResult} with the status * {@link CellNetworkScanResult#STATUS_SUCCESS} and a list of * {@link com.android.internal.telephony.OperatorInfo} if it's available. Otherwise, the failure * caused will be included in the result. * * @hide * TODO: Add an overload that takes no args. */ public CellNetworkScanResult getCellNetworkScanResults(int subId) { @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public CellNetworkScanResult getAvailableNetworks() { try { ITelephony telephony = getITelephony(); if (telephony != null) return telephony.getCellNetworkScanResults(subId); if (telephony != null) { return telephony.getCellNetworkScanResults(getSubId()); } } catch (RemoteException ex) { Rlog.e(TAG, "getCellNetworkScanResults RemoteException", ex); Rlog.e(TAG, "getAvailableNetworks RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "getCellNetworkScanResults NPE", ex); Rlog.e(TAG, "getAvailableNetworks NPE", ex); } return null; return new CellNetworkScanResult( CellNetworkScanResult.STATUS_UNKNOWN_ERROR, null /* OperatorInfo */); } /** Loading Loading @@ -5774,6 +5788,9 @@ public class TelephonyManager { /** * Ask the radio to connect to the input network and change selection mode to manual. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). Loading Loading @@ -7526,6 +7543,9 @@ public class TelephonyManager { /** * Returns the current {@link ServiceState} information. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}). */ Loading Loading @@ -7993,8 +8013,12 @@ public class TelephonyManager { } /** * Check if phone is in emergency callback mode * @return true if phone is in emergency callback mode * Checks if phone is in emergency callback mode. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * @return true if phone is in emergency callback mode. * @hide */ @SystemApi Loading Loading
telephony/java/android/telephony/TelephonyManager.java +40 −16 Original line number Diff line number Diff line Loading @@ -2862,9 +2862,11 @@ public class TelephonyManager { } /** * Return if the current radio is LTE on CDMA. This * is a tri-state return value as for a period of time * the mode may be unknown. * Return if the current radio is LTE on CDMA. This is a tri-state return value as for a period * of time the mode may be unknown. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE} * or {@link PhoneConstants#LTE_ON_CDMA_TRUE} Loading Loading @@ -5682,6 +5684,9 @@ public class TelephonyManager { /** * Sets the network selection mode to automatic. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). Loading @@ -5704,27 +5709,36 @@ public class TelephonyManager { /** * Perform a radio scan and return the list of available networks. * * The return value is a list of the OperatorInfo of the networks found. Note that this * scan can take a long time (sometimes minutes) to happen. * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * <p> Note that this scan can take a long time (sometimes minutes) to happen. * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier * privileges (see {@link #hasCarrierPrivileges}) * * @return {@link CellNetworkScanResult} with the status * {@link CellNetworkScanResult#STATUS_SUCCESS} and a list of * {@link com.android.internal.telephony.OperatorInfo} if it's available. Otherwise, the failure * caused will be included in the result. * * @hide * TODO: Add an overload that takes no args. */ public CellNetworkScanResult getCellNetworkScanResults(int subId) { @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public CellNetworkScanResult getAvailableNetworks() { try { ITelephony telephony = getITelephony(); if (telephony != null) return telephony.getCellNetworkScanResults(subId); if (telephony != null) { return telephony.getCellNetworkScanResults(getSubId()); } } catch (RemoteException ex) { Rlog.e(TAG, "getCellNetworkScanResults RemoteException", ex); Rlog.e(TAG, "getAvailableNetworks RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "getCellNetworkScanResults NPE", ex); Rlog.e(TAG, "getAvailableNetworks NPE", ex); } return null; return new CellNetworkScanResult( CellNetworkScanResult.STATUS_UNKNOWN_ERROR, null /* OperatorInfo */); } /** Loading Loading @@ -5774,6 +5788,9 @@ public class TelephonyManager { /** * Ask the radio to connect to the input network and change selection mode to manual. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). Loading Loading @@ -7526,6 +7543,9 @@ public class TelephonyManager { /** * Returns the current {@link ServiceState} information. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}). */ Loading Loading @@ -7993,8 +8013,12 @@ public class TelephonyManager { } /** * Check if phone is in emergency callback mode * @return true if phone is in emergency callback mode * Checks if phone is in emergency callback mode. * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * @return true if phone is in emergency callback mode. * @hide */ @SystemApi Loading