diff options
| author | Nancy Chen <nancychen@google.com> | 2014-10-31 22:11:59 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2014-10-31 22:11:59 +0000 |
| commit | 6a44c194e7a40af82918cf31d44c00d30e92fa24 (patch) | |
| tree | 5808c1de3c147dba1124f04309e7bc31267b434e | |
| parent | c56a9d10f7b5ffa9a6023f3dff043cbea8b3cb96 (diff) | |
| parent | 346f9070a45798d3edf38b4abaf39600630dd403 (diff) | |
| download | frameworks_base-6a44c194e7a40af82918cf31d44c00d30e92fa24.zip frameworks_base-6a44c194e7a40af82918cf31d44c00d30e92fa24.tar.gz frameworks_base-6a44c194e7a40af82918cf31d44c00d30e92fa24.tar.bz2 | |
am e1678ddf: Merge "Handle MMI for multi-SIM (1/3)" into lmp-mr1-dev
automerge: 346f907
* commit '346f9070a45798d3edf38b4abaf39600630dd403':
Handle MMI for multi-SIM (1/3)
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/TelecomManager.java | 26 | ||||
| -rw-r--r-- | telecomm/java/com/android/internal/telecom/ITelecomService.aidl | 5 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 11 |
4 files changed, 43 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index 4445e3f..8d71375 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28394,6 +28394,7 @@ package android.telecom { method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle); method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsForPackage(); method public boolean handleMmi(java.lang.String); + method public boolean handleMmi(android.telecom.PhoneAccountHandle, java.lang.String); method public boolean hasMultipleCallCapableAccounts(); method public boolean isInCall(); method public void registerPhoneAccount(android.telecom.PhoneAccount); diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index b771879..4eac5ac 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -895,6 +895,7 @@ public class TelecomManager { * Processes the specified dial string as an MMI code. * MMI codes are any sequence of characters entered into the dialpad that contain a "*" or "#". * Some of these sequences launch special behavior through handled by Telephony. + * This method uses the default subscription. * <p> * Requires that the method-caller be set as the system dialer app. * </p> @@ -915,6 +916,31 @@ public class TelecomManager { } /** + * Processes the specified dial string as an MMI code. + * MMI codes are any sequence of characters entered into the dialpad that contain a "*" or "#". + * Some of these sequences launch special behavior through handled by Telephony. + * <p> + * Requires that the method-caller be set as the system dialer app. + * </p> + * + * @param accountHandle The handle for the account the MMI code should apply to. + * @param dialString The digits to dial. + * @return True if the digits were processed as an MMI code, false otherwise. + * + */ + public boolean handleMmi(PhoneAccountHandle accountHandle, String dialString) { + ITelecomService service = getTelecomService(); + if (service != null) { + try { + return service.handlePinMmiForPhoneAccount(accountHandle, dialString); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelecomService#handlePinMmi", e); + } + } + return false; + } + + /** * Removes the missed-call notification if one is present. * <p> * Requires that the method-caller be set as the system dialer app. diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl index 91f44b9..fd47213 100644 --- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl +++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl @@ -169,6 +169,11 @@ interface ITelecomService { boolean handlePinMmi(String dialString); /** + * @see TelecomServiceImpl#handleMmi + */ + boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString); + + /** * @see TelecomServiceImpl#isTtySupported */ boolean isTtySupported(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index bd4ea56..fb3d1ff 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3332,6 +3332,17 @@ public class TelephonyManager { /** @hide */ @SystemApi + public boolean handlePinMmiForSubscriber(int subId, String dialString) { + try { + return getITelephony().handlePinMmiForSubscriber(subId, dialString); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#handlePinMmi", e); + } + return false; + } + + /** @hide */ + @SystemApi public void toggleRadioOnOff() { try { getITelephony().toggleRadioOnOff(); |
