diff options
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 59 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 31 |
2 files changed, 90 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 4459c36..1c84741 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1695,6 +1695,15 @@ public class TelephonyManager { */ /** {@hide} */ public String getLine1Number(long subId) { + String number = null; + try { + number = getITelephony().getLine1NumberForDisplay(subId); + } catch (RemoteException ex) { + } catch (NullPointerException ex) { + } + if (number != null) { + return number; + } try { return getSubscriberInfo().getLine1NumberUsingSubId(subId); } catch (RemoteException ex) { @@ -1706,6 +1715,47 @@ public class TelephonyManager { } /** + * Set the phone number string and its alphatag for line 1 for display + * purpose only, for example, displayed in Phone Status. It won't change + * the actual MSISDN/MDN. This setting won't be persisted during power cycle + * and it should be set again after reboot. + * <p> + * Requires Permission: + * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * + * @param alphaTag alpha-tagging of the dailing nubmer + * @param number The dialing number + * + * @hide + */ + public void setLine1NumberForDisplay(String alphaTag, String number) { + setLine1NumberForDisplay(getDefaultSubscription(), alphaTag, number); + } + + /** + * Set the phone number string and its alphatag for line 1 for display + * purpose only, for example, displayed in Phone Status. It won't change + * the actual MSISDN/MDN. This setting won't be persisted during power cycle + * and it should be set again after reboot. + * <p> + * Requires Permission: + * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * + * @param subId the subscriber that the alphatag and dialing number belongs to. + * @param alphaTag alpha-tagging of the dailing nubmer + * @param number The dialing number + * + * @hide + */ + public void setLine1NumberForDisplay(long subId, String alphaTag, String number) { + try { + getITelephony().setLine1NumberForDisplay(subId, alphaTag, number); + } catch (RemoteException ex) { + } catch (NullPointerException ex) { + } + } + + /** * Returns the alphabetic identifier associated with the line 1 number. * Return null if it is unavailable. * <p> @@ -1730,6 +1780,15 @@ public class TelephonyManager { */ /** {@hide} */ public String getLine1AlphaTag(long subId) { + String alphaTag = null; + try { + alphaTag = getITelephony().getLine1AlphaTagForDisplay(subId); + } catch (RemoteException ex) { + } catch (NullPointerException ex) { + } + if (alphaTag != null) { + return alphaTag; + } try { return getSubscriberInfo().getLine1AlphaTagUsingSubId(subId); } catch (RemoteException ex) { diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 7f0203a..4592717 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -675,5 +675,36 @@ interface ITelephony { * @return true if the simplified UI is enabled. */ boolean getSimplifiedNetworkSettingsEnabled(long subId); + + /** + * Set the phone number string and its alphatag for line 1 for display + * purpose only, for example, displayed in Phone Status. It won't change + * the actual MSISDN/MDN. This setting won't be persisted during power cycle + * and it should be set again after reboot. + * + * @param subId the subscriber that the alphatag and dialing number belongs to. + * @param alphaTag alpha-tagging of the dailing nubmer + * @param number The dialing number + */ + void setLine1NumberForDisplay(long subId, String alphaTag, String number); + + /** + * Returns the displayed dialing number string if it was set previously via + * {@link #setLine1NumberForDisplay}. Otherwise returns null. + * + * @param subId whose dialing number for line 1 is returned. + * @return the displayed dialing number if set, or null if not set. + */ + String getLine1NumberForDisplay(long subId); + + /** + * Returns the displayed alphatag of the dialing number if it was set + * previously via {@link #setLine1NumberForDisplay}. Otherwise returns null. + * + * @param subId whose alphatag associated with line 1 is returned. + * @return the displayed alphatag of the dialing number if set, or null if + * not set. + */ + String getLine1AlphaTagForDisplay(long subId); } |