summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-10-16 18:38:21 -0700
committerNancy Chen <nancychen@google.com>2014-10-31 11:26:38 -0700
commit95e8a679335648388988337fcf08eac325768318 (patch)
tree0e0f80d77d2506e10eecf0f4e8c47c7ef615d5f3
parent425b1dc88c47e0e9d3a653ad902a69f3ec09b966 (diff)
downloadframeworks_base-95e8a679335648388988337fcf08eac325768318.zip
frameworks_base-95e8a679335648388988337fcf08eac325768318.tar.gz
frameworks_base-95e8a679335648388988337fcf08eac325768318.tar.bz2
Handle MMI for multi-SIM (1/3)
+ Add Telecomm and Telephony methods for handlePinMMIForSubscriber + Add Select Account dialog in Dialer for MMI Bug: 17917937 Change-Id: I26fdc68a07ca0483bf7a052598fe31b1461fd486
-rw-r--r--api/current.txt1
-rw-r--r--telecomm/java/android/telecom/TelecomManager.java26
-rw-r--r--telecomm/java/com/android/internal/telecom/ITelecomService.aidl5
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java11
4 files changed, 43 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index fa02c4e..633e049 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28387,6 +28387,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 bc51a70..ec7f5e2 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -876,6 +876,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>
@@ -896,6 +897,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 a3546ed..0246a2d 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -3336,6 +3336,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();