diff options
author | Shishir Agrawal <shishir@google.com> | 2014-12-01 11:48:53 -0800 |
---|---|---|
committer | Shishir Agrawal <shishir@google.com> | 2014-12-01 11:48:53 -0800 |
commit | 0201a6f6f16a872405a5f9ee65026e948eb162d0 (patch) | |
tree | b65f2da0cb63cd38fd8c3a03238951dd424493e5 | |
parent | 6ca3ba73b78be57dd50fe5813f076b3e166cc659 (diff) | |
download | frameworks_base-0201a6f6f16a872405a5f9ee65026e948eb162d0.zip frameworks_base-0201a6f6f16a872405a5f9ee65026e948eb162d0.tar.gz frameworks_base-0201a6f6f16a872405a5f9ee65026e948eb162d0.tar.bz2 |
TelephonyManager.setLine1NumberForDisplay should return a boolean.
The call can fail and should return the success status of the call.
Bug: 18571337
Change-Id: I5f4a0bd65c807a018d2f2df9e39cf9125252257f
-rw-r--r-- | api/current.txt | 2 | ||||
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 11 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 3 |
3 files changed, 10 insertions, 6 deletions
diff --git a/api/current.txt b/api/current.txt index 707ddab..d139136 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28721,7 +28721,7 @@ package android.telephony { method public void listen(android.telephony.PhoneStateListener, int); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); method public boolean setGlobalPreferredNetworkType(); - method public void setLine1NumberForDisplay(java.lang.String, java.lang.String); + method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String); method public boolean setOperatorBrandOverride(java.lang.String); method public boolean setVoiceMailNumber(java.lang.String, java.lang.String); field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE"; diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 1b54eec..53f1945 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1811,9 +1811,10 @@ public class TelephonyManager { * * @param alphaTag alpha-tagging of the dailing nubmer * @param number The dialing number + * @return true if the operation was executed correctly. */ - public void setLine1NumberForDisplay(String alphaTag, String number) { - setLine1NumberForDisplayForSubscriber(getDefaultSubscription(), alphaTag, number); + public boolean setLine1NumberForDisplay(String alphaTag, String number) { + return setLine1NumberForDisplayForSubscriber(getDefaultSubscription(), alphaTag, number); } /** @@ -1828,14 +1829,16 @@ public class TelephonyManager { * @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 + * @return true if the operation was executed correctly. * @hide */ - public void setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number) { + public boolean setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number) { try { - getITelephony().setLine1NumberForDisplayForSubscriber(subId, alphaTag, number); + return getITelephony().setLine1NumberForDisplayForSubscriber(subId, alphaTag, number); } catch (RemoteException ex) { } catch (NullPointerException ex) { } + return false; } /** diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index adb3bc4..0a50d54 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -740,8 +740,9 @@ interface ITelephony { * @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 + * @return true if the operation was executed correctly. */ - void setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number); + boolean setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number); /** * Returns the displayed dialing number string if it was set previously via |