diff options
author | Shishir Agrawal <shishir@google.com> | 2015-06-22 18:19:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-22 18:19:58 +0000 |
commit | c242d9d2aeececeda4c980dfa119b3414d818424 (patch) | |
tree | 34a143179ab314be15e2482cfe0e124293b192ee /telephony/java/android | |
parent | de4aecd8310f61d7fe9f06a5a1f684247f88d437 (diff) | |
parent | d4f2bcdab5a43e6439babfd5eefeaff908b73870 (diff) | |
download | frameworks_base-c242d9d2aeececeda4c980dfa119b3414d818424.zip frameworks_base-c242d9d2aeececeda4c980dfa119b3414d818424.tar.gz frameworks_base-c242d9d2aeececeda4c980dfa119b3414d818424.tar.bz2 |
Merge "Adding hidden TM calls to scan/select cell networks." into mnc-dev
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index f77d268..b7ca749 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -33,9 +33,11 @@ import android.telecom.PhoneAccount; import android.util.Log; import com.android.internal.telecom.ITelecomService; +import com.android.internal.telephony.CellNetworkScanResult; import com.android.internal.telephony.IPhoneSubInfo; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.ITelephonyRegistry; +import com.android.internal.telephony.OperatorInfo; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.RILConstants; import com.android.internal.telephony.TelephonyProperties; @@ -3433,6 +3435,55 @@ public class TelephonyManager { } /** + * Perform a radio scan and return the list of avialble 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> + * Requires Permission: + * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges + * + * @hide + */ + public CellNetworkScanResult getCellNetworkScanResults(int subId) { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) + return telephony.getCellNetworkScanResults(subId); + } catch (RemoteException ex) { + Rlog.e(TAG, "getCellNetworkScanResults RemoteException", ex); + } catch (NullPointerException ex) { + Rlog.e(TAG, "getCellNetworkScanResults NPE", ex); + } + return null; + } + + /** + * Ask the radio to connect to the input network and change selection mode to manual. + * + * <p> + * Requires Permission: + * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges + * + * @hide + */ + public boolean setNetworkSelectionModeManual(int subId, OperatorInfo operator) { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) + return telephony.setNetworkSelectionModeManual(subId, operator); + } catch (RemoteException ex) { + Rlog.e(TAG, "setNetworkSelectionModeManual RemoteException", ex); + } catch (NullPointerException ex) { + Rlog.e(TAG, "setNetworkSelectionModeManual NPE", ex); + } + return false; + } + + /** * Set the preferred network type. * Used for device configuration by some CDMA operators. * <p> |