summaryrefslogtreecommitdiffstats
path: root/telephony/java/com
diff options
context:
space:
mode:
authorJohn Wang <>2009-03-27 16:38:58 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-27 16:38:58 -0700
commit38e260a62020af0e6ca45d5a9cc3f8e8c9a2842c (patch)
tree0091f09f1d54af769aad37ccbb6e18d4e4bb13cd /telephony/java/com
parenta7f1e5c540ff7b94c212facdcd89459cba3e4edc (diff)
downloadframeworks_base-38e260a62020af0e6ca45d5a9cc3f8e8c9a2842c.zip
frameworks_base-38e260a62020af0e6ca45d5a9cc3f8e8c9a2842c.tar.gz
frameworks_base-38e260a62020af0e6ca45d5a9cc3f8e8c9a2842c.tar.bz2
AI 143181: am: CL 142924 Support DCM specific MMI network service.
IExtendedNetworkService has 4 MMI service interface used by PhoneUtils to put DCM related nw service. void setMmiString(String number); CharSequence getMmiRunningText(); CharSequence getUserMessage(CharSequence text); void clearMmiString(); And the service is bind via "com.android.ussd.IExtendedNetworkService". Original author: johnwang Merged from: //branches/cupcake/... Automated import of CL 143181
Diffstat (limited to 'telephony/java/com')
-rw-r--r--telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl31
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java24
2 files changed, 52 insertions, 3 deletions
diff --git a/telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl b/telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl
new file mode 100644
index 0000000..6c1f4bb
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl
@@ -0,0 +1,31 @@
+package com.android.internal.telephony;
+
+/**
+ * Interface used to interact with extended MMI/USSD network service.
+ */
+interface IExtendedNetworkService {
+ /**
+ * Set a MMI/USSD command to ExtendedNetworkService for further process.
+ * This should be called when a MMI command is placed from panel.
+ * @param number the dialed MMI/USSD number.
+ */
+ void setMmiString(String number);
+
+ /**
+ * return the specific string which is used to prompt MMI/USSD is running
+ */
+ CharSequence getMmiRunningText();
+
+ /**
+ * Get specific message which should be displayed on pop-up dialog.
+ * @param text original MMI/USSD message response from framework
+ * @return specific user message correspond to text. null stands for no pop-up dialog need to show.
+ */
+ CharSequence getUserMessage(CharSequence text);
+
+ /**
+ * Clear pre-set MMI/USSD command.
+ * This should be called when user cancel a pre-dialed MMI command.
+ */
+ void clearMmiString();
+}
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java
index ce6c186..04f8332 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java
@@ -1212,9 +1212,11 @@ public final class GsmMmiCode extends Handler implements MmiCode
} else if (sc.equals(SC_WAIT)) {
// Call Waiting includes additional data in the response.
sb.append(createQueryCallWaitingResultMessage(ints[1]));
- } else if (isServiceCodeCallBarring(sc) || (ints[0] == 1)) {
+ } else if (isServiceCodeCallBarring(sc)) {
// ints[0] for Call Barring is a bit vector of services
- // for all other services, treat it as a boolean
+ sb.append(createQueryCallBarringResultMessage(ints[0]));
+ } else if (ints[0] == 1) {
+ // for all other services, treat it as a boolean
sb.append(context.getText(com.android.internal.R.string.serviceEnabled));
} else {
sb.append(context.getText(com.android.internal.R.string.mmiError));
@@ -1245,7 +1247,23 @@ public final class GsmMmiCode extends Handler implements MmiCode
}
return sb;
}
-
+ private CharSequence
+ createQueryCallBarringResultMessage(int serviceClass)
+ {
+ StringBuilder sb = new StringBuilder(context.getText(com.android.internal.R.string.serviceEnabledFor));
+
+ for (int classMask = 1
+ ; classMask <= SERVICE_CLASS_MAX
+ ; classMask <<= 1
+ ) {
+ if ((classMask & serviceClass) != 0) {
+ sb.append("\n");
+ sb.append(serviceClassToCFString(classMask & serviceClass));
+ }
+ }
+ return sb;
+ }
+
/***
* TODO: It would be nice to have a method here that can take in a dialstring and
* figure out if there is an MMI code embedded within it. This code would replace