diff --git a/api/current.xml b/api/current.xml
index 4db6e661b94df..860cce4b9df52 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -309,6 +309,17 @@
visibility="public"
>
+ Type: TEXT Type: INTEGER Type: INTEGER Type: INTEGER (boolean) Type: INTEGER REFERENCES data(_id) Type: INTEGER REFERENCES data(_id) Type: INTEGER REFERENCES data(_id) Type: INTEGER REFERENCES data(_id) Type: INTEGER Type: TEXT Type: TEXT Type: INTEGER (if set, non-0 means true) Type: TEXT Type: TEXT Type: TEXT Type: TEXT Type: TEXT Type: TEXT Type: TEXT Type: INTEGER Type: TEXT Type: TEXT Type: INTEGER Type: TEXT Type: TEXT Type: TEXT Type: INTEGER (if set, non-0 means true)
+ * Type: BLOB
+ */
+ public static final String PHOTO = "data1";
+ }
+
+ /**
+ * Notes about the contact.
+ */
+ public static final class Note implements BaseCommonColumns {
+ private Note() {}
+
+ /** Mime-type used when storing this in data table. */
+ public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/note";
+
+ /**
+ * The note text.
+ * Type: TEXT Type: INTEGER (if set, non-0 means true) Type: TEXT
+ * Type: TEXT
+ */
+ public static final String PACKAGE = "package";
+
+ /**
+ * The mime-type of this social activity.
+ *
+ * Type: TEXT
+ */
+ public static final String MIMETYPE = "mimetype";
+
+ /**
+ * Internal raw identifier for this social activity. This field is
+ * analogous to the
+ * Type: TEXT
+ */
+ public static final String RAW_ID = "raw_id";
+
+ /**
+ * Reference to another {@link Activities#RAW_ID} that this social activity
+ * is replying to. This field is analogous to the
+ *
+ * Type: TEXT
+ */
+ public static final String IN_REPLY_TO = "in_reply_to";
+
+ /**
+ * Reference to the {@link android.provider.ContactsContract.Contacts#_ID} that authored
+ * this social activity. This field is analogous to the
+ * Type: INTEGER
+ */
+ public static final String AUTHOR_CONTACT_ID = "author_contact_id";
+
+ /**
+ * Optional reference to the {@link android.provider.ContactsContract.Contacts#_ID} this
+ * social activity is targeted towards. If more than one direct target, this field may
+ * be left undefined. This field is analogous to the
+ *
+ * Type: INTEGER
+ */
+ public static final String TARGET_CONTACT_ID = "target_contact_id";
+
+ /**
+ * Timestamp when this social activity was published, in a
+ * {@link System#currentTimeMillis()} time base. This field is analogous
+ * to the
+ * Type: INTEGER
+ */
+ public static final String PUBLISHED = "published";
+
+ /**
+ * Timestamp when the original social activity in a thread was
+ * published. For activities that have an in-reply-to field specified, the
+ * content provider will automatically populate this field with the
+ * timestamp of the original activity.
+ *
+ * This field is useful for sorting order of activities that keeps together all
+ * messages in each thread.
+ *
+ * Type: INTEGER
+ */
+ public static final String THREAD_PUBLISHED = "thread_published";
+
+ /**
+ * Title of this social activity. This field is analogous to the
+ *
+ * Type: TEXT
+ */
+ public static final String TITLE = "title";
+
+ /**
+ * Summary of this social activity. This field is analogous to the
+ *
+ * Type: TEXT
+ */
+ public static final String SUMMARY = "summary";
+
+ /**
+ * A URI associated this social activity. This field is analogous to the
+ *
+ * Type: TEXT
+ */
+ public static final String LINK = "link";
+
+ /**
+ * Optional thumbnail specific to this social activity. This is the raw
+ * bytes of an image that could be inflated using {@link BitmapFactory}.
+ *
+ * Type: BLOB
+ */
+ public static final String THUMBNAIL = "thumbnail";
+ }
+
+ public static final class Activities implements BaseColumns, ActivitiesColumns {
+ /**
+ * This utility class cannot be instantiated
+ */
+ private Activities() {
+ }
+
+ /**
+ * The content:// style URI for this table
+ */
+ public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "activities");
+
+ /**
+ * The content:// style URI for this table filtered to the set of social activities
+ * authored by a specific {@link android.provider.ContactsContract.Contacts#_ID}.
+ */
+ public static final Uri CONTENT_AUTHORED_BY_URI =
+ Uri.withAppendedPath(CONTENT_URI, "authored_by");
+
+ /**
+ * The MIME type of {@link #CONTENT_URI} providing a directory of social
+ * activities.
+ */
+ public static final String CONTENT_TYPE = "vnd.android.cursor.dir/activity";
+
+ /**
+ * The MIME type of a {@link #CONTENT_URI} subdirectory of a single
+ * social activity.
+ */
+ public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/activity";
+ }
+
+}
diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java
index a4145c487696b..4078fa6d5a734 100644
--- a/core/java/android/provider/Telephony.java
+++ b/core/java/android/provider/Telephony.java
@@ -465,6 +465,24 @@ public final class Telephony {
* Contains info about SMS related Intents that are broadcast.
*/
public static final class Intents {
+ /**
+ * Set by BroadcastReceiver. Indicates the message was handled
+ * successfully.
+ */
+ public static final int RESULT_SMS_HANDLED = 1;
+
+ /**
+ * Set by BroadcastReceiver. Indicates a generic error while
+ * processing the message.
+ */
+ public static final int RESULT_SMS_GENERIC_ERROR = 2;
+
+ /**
+ * Set by BroadcastReceiver. Indicates insufficient memory to store
+ * the message.
+ */
+ public static final int RESULT_SMS_OUT_OF_MEMORY = 3;
+
/**
* Broadcast Action: A new text based SMS message has been received
* by the device. The intent will have the following extra
@@ -476,7 +494,10 @@ public final class Telephony {
*
*
* The extra values can be extracted using
- * {@link #getMessagesFromIntent(Intent)}atom:id element defined in RFC 4287.
+ * thr:in-reply-to element defined in RFC 4685.
+ * atom:author
+ * element defined in RFC 4287.
+ * activity:target element defined in the Atom Activity
+ * Extensions Internet-Draft.
+ * atom:published element defined in RFC 4287.
+ * atom:title element defined in RFC 4287.
+ * atom:summary element defined in RFC 4287.
+ * atom:link rel="alternate" element defined in RFC 4287.
+ *
If a BroadcastReceiver encounters an error while processing + * this intent it should set the result code appropriately.
*/ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String SMS_RECEIVED_ACTION = @@ -493,7 +514,10 @@ public final class Telephony { * * *The extra values can be extracted using - * {@link #getMessagesFromIntent(Intent)}
+ * {@link #getMessagesFromIntent(Intent)}. + * + *If a BroadcastReceiver encounters an error while processing + * this intent it should set the result code appropriately.
*/ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String DATA_SMS_RECEIVED_ACTION = @@ -510,6 +534,9 @@ public final class Telephony { *If a BroadcastReceiver encounters an error while processing + * this intent it should set the result code appropriately.
*/ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String WAP_PUSH_RECEIVED_ACTION = diff --git a/core/java/android/speech/IRecognitionListener.aidl b/core/java/android/speech/IRecognitionListener.aidl index 6ed32b502b424..b4abfda30aed0 100644 --- a/core/java/android/speech/IRecognitionListener.aidl +++ b/core/java/android/speech/IRecognitionListener.aidl @@ -17,6 +17,7 @@ package android.speech; import android.os.Bundle; +import android.speech.RecognitionResult; /** * Listener for speech recognition events, used with RecognitionService. @@ -43,13 +44,19 @@ interface IRecognitionListener { /** Called after the user stops speaking. */ void onEndOfSpeech(); - /** A network or recognition error occurred. */ - void onError(in String error); + /** + * A network or recognition error occurred. + * TODO: right now, the error code is given in voice search package + * (vendor/google/apps/src/com/google/android/voicesearch/speechservice/SpeechServiceListener.java) + * we need to find a place to define common error code. + */ + void onError(in int error); /** - * Called when recognition transcripts are ready. - * results: an ordered list of the most likely transcripts (N-best list). - * @hide + * Called when recognition results are ready. + * @param results: an ordered list of the most likely results (N-best list). + * @param key: a key associated with the results. The same results can + * be retrieved asynchronously later using the key, if available. */ - void onResults(in ListSets the type of gestures to use with this list. When gestures are enabled,
* that is if the Call setup() before adding tabs if loading TabHost using findViewById(). However: You do
- * not need to call setup() after getTabHost() in {@link android.app.TabActivity TabActivity}.
+ * Call setup() before adding tabs if loading TabHost using findViewById().
+ * However: You do not need to call setup() after getTabHost()
+ * in {@link android.app.TabActivity TabActivity}.
* Example:gestures parameter is not {@link #GESTURES_NONE},
@@ -663,7 +664,7 @@ public abstract class AbsListView extends AdapterViewmTabHost = (TabHost)findViewById(R.id.tabhost);
mTabHost.setup();
@@ -363,14 +364,14 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1");
*
* @param tag
* Which tab was selected.
- * @return The view to distplay the contents of the selected tab.
+ * @return The view to display the contents of the selected tab.
*/
View createTabContent(String tag);
}
/**
- * A tab has a tab indictor, content, and a tag that is used to keep
+ * A tab has a tab indicator, content, and a tag that is used to keep
* track of it. This builder helps choose among these options.
*
* For the tab indicator, your choices are:
@@ -607,7 +608,7 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1");
}
mLaunchedView = wd;
- // XXX Set FOCUS_AFTER_DESCENDANTS on embedded activies for now so they can get
+ // XXX Set FOCUS_AFTER_DESCENDANTS on embedded activities for now so they can get
// focus if none of their children have it. They need focus to be able to
// display menu items.
//
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index a448ac6d4c692..51f3b025f84dc 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -53,7 +53,7 @@ public final class BatteryStatsImpl extends BatteryStats {
private static final int MAGIC = 0xBA757475; // 'BATSTATS'
// Current on-disk Parcel version
- private static final int VERSION = 36;
+ private static final int VERSION = 37;
private final File mFile;
private final File mBackupFile;
@@ -3014,6 +3014,8 @@ public final class BatteryStatsImpl extends BatteryStats {
u.mWifiTurnedOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
u.mFullWifiLockTimer.writeSummaryFromParcelLocked(out, NOWREAL);
+ u.mAudioTurnedOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
+ u.mVideoTurnedOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
u.mScanWifiLockTimer.writeSummaryFromParcelLocked(out, NOWREAL);
u.mWifiMulticastTimer.writeSummaryFromParcelLocked(out, NOWREAL);
diff --git a/core/jni/android_os_MemoryFile.cpp b/core/jni/android_os_MemoryFile.cpp
index edf7dc45991b9..9450e158dee55 100644
--- a/core/jni/android_os_MemoryFile.cpp
+++ b/core/jni/android_os_MemoryFile.cpp
@@ -26,7 +26,7 @@
namespace android {
-static jint android_os_MemoryFile_open(JNIEnv* env, jobject clazz, jstring name, jint length)
+static jobject android_os_MemoryFile_open(JNIEnv* env, jobject clazz, jstring name, jint length)
{
const char* namestr = (name ? env->GetStringUTFChars(name, NULL) : NULL);
@@ -37,28 +37,45 @@ static jint android_os_MemoryFile_open(JNIEnv* env, jobject clazz, jstring name,
if (name)
env->ReleaseStringUTFChars(name, namestr);
- if (result < 0)
+ if (result < 0) {
jniThrowException(env, "java/io/IOException", "ashmem_create_region failed");
- return result;
+ return NULL;
+ }
+
+ return jniCreateFileDescriptor(env, result);
}
-static jint android_os_MemoryFile_mmap(JNIEnv* env, jobject clazz, jint fd, jint length)
+static jint android_os_MemoryFile_mmap(JNIEnv* env, jobject clazz, jobject fileDescriptor,
+ jint length)
{
+ int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
jint result = (jint)mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (!result)
jniThrowException(env, "java/io/IOException", "mmap failed");
return result;
}
-static void android_os_MemoryFile_close(JNIEnv* env, jobject clazz, jint fd)
+static void android_os_MemoryFile_munmap(JNIEnv* env, jobject clazz, jint addr, jint length)
{
- close(fd);
+ int result = munmap((void *)addr, length);
+ if (result < 0)
+ jniThrowException(env, "java/io/IOException", "munmap failed");
+}
+
+static void android_os_MemoryFile_close(JNIEnv* env, jobject clazz, jobject fileDescriptor)
+{
+ int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
+ if (fd >= 0) {
+ jniSetFileDescriptorOfFD(env, fileDescriptor, -1);
+ close(fd);
+ }
}
static jint android_os_MemoryFile_read(JNIEnv* env, jobject clazz,
- jint fd, jint address, jbyteArray buffer, jint srcOffset, jint destOffset,
+ jobject fileDescriptor, jint address, jbyteArray buffer, jint srcOffset, jint destOffset,
jint count, jboolean unpinned)
{
+ int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
if (unpinned && ashmem_pin_region(fd, 0, 0) == ASHMEM_WAS_PURGED) {
ashmem_unpin_region(fd, 0, 0);
jniThrowException(env, "java/io/IOException", "ashmem region was purged");
@@ -76,9 +93,10 @@ static jint android_os_MemoryFile_read(JNIEnv* env, jobject clazz,
}
static jint android_os_MemoryFile_write(JNIEnv* env, jobject clazz,
- jint fd, jint address, jbyteArray buffer, jint srcOffset, jint destOffset,
+ jobject fileDescriptor, jint address, jbyteArray buffer, jint srcOffset, jint destOffset,
jint count, jboolean unpinned)
{
+ int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
if (unpinned && ashmem_pin_region(fd, 0, 0) == ASHMEM_WAS_PURGED) {
ashmem_unpin_region(fd, 0, 0);
jniThrowException(env, "java/io/IOException", "ashmem region was purged");
@@ -95,8 +113,9 @@ static jint android_os_MemoryFile_write(JNIEnv* env, jobject clazz,
return count;
}
-static void android_os_MemoryFile_pin(JNIEnv* env, jobject clazz, jint fd, jboolean pin)
+static void android_os_MemoryFile_pin(JNIEnv* env, jobject clazz, jobject fileDescriptor, jboolean pin)
{
+ int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
int result = (pin ? ashmem_pin_region(fd, 0, 0) : ashmem_unpin_region(fd, 0, 0));
if (result < 0) {
jniThrowException(env, "java/io/IOException", NULL);
@@ -104,12 +123,13 @@ static void android_os_MemoryFile_pin(JNIEnv* env, jobject clazz, jint fd, jbool
}
static const JNINativeMethod methods[] = {
- {"native_open", "(Ljava/lang/String;I)I", (void*)android_os_MemoryFile_open},
- {"native_mmap", "(II)I", (void*)android_os_MemoryFile_mmap},
- {"native_close", "(I)V", (void*)android_os_MemoryFile_close},
- {"native_read", "(II[BIIIZ)I", (void*)android_os_MemoryFile_read},
- {"native_write", "(II[BIIIZ)V", (void*)android_os_MemoryFile_write},
- {"native_pin", "(IZ)V", (void*)android_os_MemoryFile_pin},
+ {"native_open", "(Ljava/lang/String;I)Ljava/io/FileDescriptor;", (void*)android_os_MemoryFile_open},
+ {"native_mmap", "(Ljava/io/FileDescriptor;I)I", (void*)android_os_MemoryFile_mmap},
+ {"native_munmap", "(II)V", (void*)android_os_MemoryFile_munmap},
+ {"native_close", "(Ljava/io/FileDescriptor;)V", (void*)android_os_MemoryFile_close},
+ {"native_read", "(Ljava/io/FileDescriptor;I[BIIIZ)I", (void*)android_os_MemoryFile_read},
+ {"native_write", "(Ljava/io/FileDescriptor;I[BIIIZ)V", (void*)android_os_MemoryFile_write},
+ {"native_pin", "(Ljava/io/FileDescriptor;Z)V", (void*)android_os_MemoryFile_pin},
};
static const char* const kClassPathName = "android/os/MemoryFile";
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index b97e07b2c1055..0a24bb782313f 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -644,6 +644,13 @@
android:description="@string/permdesc_changeWifiState"
android:label="@string/permlab_changeWifiState" />
+
+
* Example: The status bar uses this to determine when to display the
* voicemail icon.
@@ -62,7 +68,9 @@ public class PhoneStateListener {
/**
* Listen for changes to the call-forwarding indicator.
- *
+ * {@more}
+ * Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE
+ * READ_PHONE_STATE}
* @see #onCallForwardingIndicatorChanged
*/
public static final int LISTEN_CALL_FORWARDING_INDICATOR = 0x00000008;
@@ -85,7 +93,9 @@ public class PhoneStateListener {
/**
* Listen for changes to the device call state.
- *
+ * {@more}
+ * Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE
+ * READ_PHONE_STATE}
* @see #onCallStateChanged
*/
public static final int LISTEN_CALL_STATE = 0x00000020;
@@ -100,7 +110,9 @@ public class PhoneStateListener {
/**
* Listen for changes to the direction of data traffic on the data
* connection (cellular).
- *
+ * {@more}
+ * Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE
+ * READ_PHONE_STATE}
* Example: The status bar uses this to display the appropriate
* data-traffic icon.
*
diff --git a/telephony/java/com/android/internal/telephony/BaseCommands.java b/telephony/java/com/android/internal/telephony/BaseCommands.java
index e78422e449de4..dba497250314a 100644
--- a/telephony/java/com/android/internal/telephony/BaseCommands.java
+++ b/telephony/java/com/android/internal/telephony/BaseCommands.java
@@ -54,10 +54,11 @@ public abstract class BaseCommands implements CommandsInterface {
protected RegistrantList mIccStatusChangedRegistrants = new RegistrantList();
protected RegistrantList mVoicePrivacyOnRegistrants = new RegistrantList();
protected RegistrantList mVoicePrivacyOffRegistrants = new RegistrantList();
- protected RegistrantList mOtaSessionRegistrants = new RegistrantList();
- protected RegistrantList mCallWaitingRegistrants = new RegistrantList();
- protected RegistrantList mInformationRecordsRegistrants = new RegistrantList();
protected Registrant mUnsolOemHookRawRegistrant;
+ protected RegistrantList mOtaProvisionRegistrants = new RegistrantList();
+ protected RegistrantList mCallWaitingInfoRegistrants = new RegistrantList();
+ protected RegistrantList mDisplayInfoRegistrants = new RegistrantList();
+ protected RegistrantList mSignalInfoRegistrants = new RegistrantList();
protected Registrant mSMSRegistrant;
protected Registrant mNITZTimeRegistrant;
protected Registrant mSignalStrengthRegistrant;
@@ -464,6 +465,29 @@ public abstract class BaseCommands implements CommandsInterface {
mRestrictedStateRegistrant.clear();
}
+ public void registerForDisplayInfo(Handler h, int what, Object obj) {
+ Registrant r = new Registrant (h, what, obj);
+ mDisplayInfoRegistrants.add(r);
+ }
+
+ public void unregisterForDisplayInfo(Handler h) {
+ mDisplayInfoRegistrants.remove(h);
+ }
+
+ public void registerForCallWaitingInfo(Handler h, int what, Object obj) {
+ Registrant r = new Registrant (h, what, obj);
+ mCallWaitingInfoRegistrants.add(r);
+ }
+
+ public void unregisterForCallWaitingInfo(Handler h) {
+ mCallWaitingInfoRegistrants.remove(h);
+ }
+
+ public void registerForSignalInfo(Handler h, int what, Object obj) {
+ Registrant r = new Registrant (h, what, obj);
+ mSignalInfoRegistrants.add(r);
+ }
+
public void setOnUnsolOemHookRaw(Handler h, int what, Object obj) {
mUnsolOemHookRawRegistrant = new Registrant (h, what, obj);
}
@@ -472,32 +496,19 @@ public abstract class BaseCommands implements CommandsInterface {
mUnsolOemHookRawRegistrant.clear();
}
- public void registerForOtaSessionStatus(Handler h, int what, Object obj){
+ public void unregisterForSignalInfo(Handler h) {
+ mSignalInfoRegistrants.remove(h);
+ }
+
+ public void registerForCdmaOtaProvision(Handler h,int what, Object obj){
Registrant r = new Registrant (h, what, obj);
- mOtaSessionRegistrants.add(r);
+ mOtaProvisionRegistrants.add(r);
}
- public void unregisterForOtaSessionStatus(Handler h){
- mOtaSessionRegistrants.remove(h);
+ public void unregisterForCdmaOtaProvision(Handler h){
+ mOtaProvisionRegistrants.remove(h);
}
- public void registerForCdmaCallWaiting(Handler h, int what, Object obj){
- Registrant r = new Registrant (h, what, obj);
- mCallWaitingRegistrants.add(r);
- }
-
- public void unregisterForCdmaCallWaiting(Handler h){
- mCallWaitingRegistrants.remove(h);
- }
-
- public void registerCdmaInformationRecord(Handler h, int what, Object obj) {
- Registrant r = new Registrant (h, what, obj);
- mInformationRecordsRegistrants.add(r);
- }
-
- public void unregisterCdmaInformationRecord(Handler h) {
- mInformationRecordsRegistrants.remove(h);
- }
//***** Protected Methods
/**
diff --git a/telephony/java/com/android/internal/telephony/CallTracker.java b/telephony/java/com/android/internal/telephony/CallTracker.java
index eb339f869b8ab..8263ded7a2866 100644
--- a/telephony/java/com/android/internal/telephony/CallTracker.java
+++ b/telephony/java/com/android/internal/telephony/CallTracker.java
@@ -56,6 +56,7 @@ public abstract class CallTracker extends Handler {
protected static final int EVENT_CONFERENCE_RESULT = 11;
protected static final int EVENT_SEPARATE_RESULT = 12;
protected static final int EVENT_ECT_RESULT = 13;
+ protected static final int EVENT_EXIT_ECM_RESPONSE_CDMA = 14;
protected void pollCallsWhenSafe() {
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index da53e15e93ede..32f31ef4c14bb 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -70,6 +70,12 @@ public class CallerInfo {
*/
public String name;
public String phoneNumber;
+
+ public String cnapName;
+ public int numberPresentation;
+ public int namePresentation;
+ public boolean contactExists;
+
public String phoneLabel;
/* Split up the phoneLabel into number type and label name */
public int numberType;
@@ -118,6 +124,7 @@ public class CallerInfo {
info.numberLabel = null;
info.cachedPhoto = null;
info.isCachedPhotoCurrent = false;
+ info.contactExists = false;
if (Config.LOGV) Log.v(TAG, "construct callerInfo from cursor");
@@ -176,6 +183,7 @@ public class CallerInfo {
columnIndex = cursor.getColumnIndex(People.SEND_TO_VOICEMAIL);
info.shouldSendToVoicemail = (columnIndex != -1) &&
((cursor.getInt(columnIndex)) == 1);
+ info.contactExists = true;
}
cursor.close();
}
@@ -303,4 +311,3 @@ public class CallerInfo {
}
}
}
-
diff --git a/telephony/java/com/android/internal/telephony/CdmaInformationRecord.java b/telephony/java/com/android/internal/telephony/CdmaInformationRecord.java
deleted file mode 100644
index 690df058b59bc..0000000000000
--- a/telephony/java/com/android/internal/telephony/CdmaInformationRecord.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telephony;
-
-/**
- * TODO(Teleca): This class was poorly implemented and didn't
- * follow the Android coding conventions. It is now more or less
- * follows the conventions but there is still some work, see the
- * TODO's.
- */
-
-
-public class CdmaInformationRecord {
- public int messageName;
-
- public CdmaDisplayInfoRec displayInfoRec;
- public CdmaNumberInfoRec numberInfoRec;
- public CdmaSignalInfoRec signalInfoRec;
- public CdmaRedirectingNumberInfoRec redirectingNumberInfoRec;
- public CdmaLineControlInfoRec lineControlInfoRec;
- public CdmaT53ClirInfoRec cdmaT53ClirInfoRec;
- public CdmaT53AudioControlInfoRec cdmaT53AudioControlInfoRec;
-
- public static final int RIL_CDMA_DISPLAY_INFO_REC = 0;
- public static final int RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC = 1;
- public static final int RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC = 2;
- public static final int RIL_CDMA_CONNECTED_NUMBER_INFO_REC = 3;
- public static final int RIL_CDMA_SIGNAL_INFO_REC = 4;
- public static final int RIL_CDMA_REDIRECTING_NUMBER_INFO_REC = 5;
- public static final int RIL_CDMA_LINE_CONTROL_INFO_REC = 6;
- public static final int RIL_CDMA_EXTENDED_DISPLAY_INFO_REC = 7;
- public static final int RIL_CDMA_T53_CLIR_INFO_REC = 8;
- public static final int RIL_CDMA_T53_RELEASE_INFO_REC = 9;
- public static final int RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC = 10;
-
- public CdmaInformationRecord(int messageName) {
- this.messageName = messageName;
- }
-
- void createDisplayInfo(int length, char buffer[]) {
- displayInfoRec = new CdmaDisplayInfoRec(length, buffer);
- }
-
- void createNumberInfo(int length, char buffer[]) {
- numberInfoRec = new CdmaNumberInfoRec(length, buffer);
- }
-
- void createSignalInfo(char buffer[]) {
- signalInfoRec = new CdmaSignalInfoRec(buffer);
- }
-
- void createRedirectingNumberInfo(int length, char buffer[], int reason) {
- redirectingNumberInfoRec = new CdmaRedirectingNumberInfoRec(length, buffer, reason);
- }
-
- void createLineControlInfo(char buffer[]) {
- lineControlInfoRec = new CdmaLineControlInfoRec(buffer);
- }
-
- void createT53ClirInfo(char buffer) {
- cdmaT53ClirInfoRec = new CdmaT53ClirInfoRec(buffer);
- }
-
- void createT53AudioControlInfo(char ul, char dl) {
- cdmaT53AudioControlInfoRec = new CdmaT53AudioControlInfoRec(ul, dl);
- }
-
- /**
- * TODO(Teleca): Add comments for each class giving the
- * document and section where the information is defined
- * as shown CdmaSignalInfoRec. Also add a toString to
- * each of these to ease debugging.
- */
-
- /**
- * Signal Information record from 3GPP2 C.S005 3.7.5.5
- */
- public static class CdmaSignalInfoRec {
- public boolean isPresent; /* non-zero if signal information record is present */
- public int signalType;
- public int alertPitch;
- public int signalCode;
-
- public CdmaSignalInfoRec() {}
-
- public CdmaSignalInfoRec(char buffer[]) {
- isPresent = buffer[0] == 1;
- signalType = buffer[1];
- alertPitch = buffer[2];
- signalCode = buffer[3];
- }
-
- @Override
- public String toString() {
- return "CdmaSignalInfo: {" +
- " isPresent: " + isPresent +
- ", signalType: " + signalType +
- ", alertPitch: " + alertPitch +
- ", signalCode: " + signalCode +
- " }";
- }
- }
-
- public static class CdmaDisplayInfoRec {
- public char alphaLen;
- public char alphaBuf[];
-
- public CdmaDisplayInfoRec(int length, char buffer[]) {
- alphaLen = (char)length;
- alphaBuf = new char[length];
- for(int i = 0; i < length; i++)
- alphaBuf[i] = buffer[i];
- }
- }
-
- public static class CdmaNumberInfoRec {
- public int len;
- public char buf[];
- public char numberType;
- public char numberPlan;
- public char pi; // TODO(Teleca): poor name, no meaning
- public char si; // TODO(Teleca): poor name
-
- public CdmaNumberInfoRec(int length, char buffer[]) {
- int i;
-
- len = length;
- buf = new char[length];
- for (i = 0; i < len; i++) {
- buf[i] = buffer[i];
- }
-
- numberType = buffer[i++];
- numberPlan = buffer[i++];
- pi = buffer[i++];
- si = buffer[i++];
- }
- }
-
- public static class CdmaRedirectingNumberInfoRec {
- public static final int REASON_UNKNOWN = 0;
- public static final int REASON_CALL_FORWARDING_BUSY = 1;
- public static final int REASON_CALL_FORWARDING_NO_REPLY = 2;
- public static final int REASON_CALLED_DTE_OUT_OF_ORDER = 9;
- public static final int REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10;
- public static final int REASON_CALL_FORWARDING_UNCONDITIONAL = 15;
-
- public CdmaNumberInfoRec numberInfoRec;
- public int redirectingReason;
-
- public CdmaRedirectingNumberInfoRec(int length, char buffer[], int reason) {
- numberInfoRec = new CdmaNumberInfoRec(length, buffer);
- redirectingReason = reason;
- }
- }
-
- public static class CdmaLineControlInfoRec {
- public char lineCtrlPolarityIncluded;
- public char lineCtrlToggle;
- public char lineCtrlReverse;
- public char lineCtrlPowerDenial;
-
- CdmaLineControlInfoRec(char buffer[]) {
- lineCtrlPolarityIncluded = buffer[0];
- lineCtrlToggle = buffer[1];
- lineCtrlReverse = buffer[2];
- lineCtrlPowerDenial = buffer[3];
- }
- }
-
- // TODO(Teleca): A class for a single character, is this needed?
- public static class CdmaT53ClirInfoRec {
- public char cause;
-
- public CdmaT53ClirInfoRec(char buffer) {
- cause = buffer;
- }
- }
-
- public static class CdmaT53AudioControlInfoRec {
- public char uplink;
- public char downlink;
-
- public CdmaT53AudioControlInfoRec(char ul, char dl) {
- uplink = ul;
- downlink = dl;
- }
- }
-}
diff --git a/telephony/java/com/android/internal/telephony/CommandsInterface.java b/telephony/java/com/android/internal/telephony/CommandsInterface.java
index ddf6b50f6f203..34a57a026d95a 100644
--- a/telephony/java/com/android/internal/telephony/CommandsInterface.java
+++ b/telephony/java/com/android/internal/telephony/CommandsInterface.java
@@ -147,6 +147,14 @@ public interface CommandsInterface {
static final int SIM_REFRESH_INIT = 1; // SIM initialized; reload all
static final int SIM_REFRESH_RESET = 2; // SIM reset; may be locked
+ // GSM SMS fail cause for acknowledgeLastIncomingSMS. From TS 23.040, 9.2.3.22.
+ static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0xD3;
+ static final int GSM_SMS_FAIL_CAUSE_UNSPECIFIED_ERROR = 0xFF;
+
+ // CDMA SMS fail cause for acknowledgeLastIncomingCdmaSms. From TS N.S00005, 6.5.2.125.
+ static final int CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE = 35;
+ static final int CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM = 39;
+
//***** Methods
RadioState getRadioState();
@@ -240,24 +248,6 @@ public interface CommandsInterface {
void registerForRUIMReady(Handler h, int what, Object obj);
void unregisterForRUIMReady(Handler h);
- /**
- * Registers for the status of an OTASP/OTAPA session
- */
- void registerForOtaSessionStatus(Handler h, int what, Object obj);
- void unregisterForOtaSessionStatus(Handler h);
-
- /**
- * register for Call waiting for CDMA
- */
- void registerForCdmaCallWaiting(Handler h, int what, Object obj);
- void unregisterForCdmaCallWaiting(Handler h);
-
- /**
- * Registers for CDMA information records
- */
- void registerCdmaInformationRecord(Handler h, int what, Object obj);
- void unregisterCdmaInformationRecord(Handler h);
-
/**
* unlike the register* methods, there's only one new SMS handler
* if you need to unregister, you should also tell the radio to stop
@@ -343,16 +333,6 @@ public interface CommandsInterface {
void setOnIccSmsFull(Handler h, int what, Object obj);
void unSetOnIccSmsFull(Handler h);
- /**
- * Sets the handler for Emergency call-back Mode enter mesage.
- * Unlike the register* methods, there's only one notification handler
- *
- * @param h Handler for notification message.
- * @param what User-defined message code.
- * @param obj User object.
- */
- void setEmergencyCallbackMode(Handler h, int what, Object obj);
-
/**
* Sets the handler for SIM Refresh notifications.
* Unlike the register* methods, there's only one notification handler
@@ -452,6 +432,49 @@ public interface CommandsInterface {
void setSuppServiceNotifications(boolean enable, Message result);
//void unSetSuppServiceNotifications(Handler h);
+ /**
+ * Sets the handler for Event Notifications for CDMA Display Info.
+ * Unlike the register* methods, there's only one notification handler
+ *
+ * @param h Handler for notification message.
+ * @param what User-defined message code.
+ * @param obj User object.
+ */
+ void registerForDisplayInfo(Handler h, int what, Object obj);
+ void unregisterForDisplayInfo(Handler h);
+
+ /**
+ * Sets the handler for Event Notifications for CallWaiting Info.
+ * Unlike the register* methods, there's only one notification handler
+ *
+ * @param h Handler for notification message.
+ * @param what User-defined message code.
+ * @param obj User object.
+ */
+ void registerForCallWaitingInfo(Handler h, int what, Object obj);
+ void unregisterForCallWaitingInfo(Handler h);
+
+ /**
+ * Sets the handler for Event Notifications for Signal Info.
+ * Unlike the register* methods, there's only one notification handler
+ *
+ * @param h Handler for notification message.
+ * @param what User-defined message code.
+ * @param obj User object.
+ */
+ void registerForSignalInfo(Handler h, int what, Object obj);
+ void unregisterForSignalInfo(Handler h);
+
+ /**
+ * Fires on if Modem enters Emergency Callback mode
+ */
+ void setEmergencyCallbackMode(Handler h, int what, Object obj);
+
+ /**
+ * Fires on any CDMA OTA provision status change
+ */
+ void registerForCdmaOtaProvision(Handler h,int what, Object obj);
+ void unregisterForCdmaOtaProvision(Handler h);
/**
* Returns current ICC status.
@@ -867,9 +890,9 @@ public interface CommandsInterface {
void setRadioPower(boolean on, Message response);
- void acknowledgeLastIncomingSMS(boolean success, Message response);
+ void acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response);
- void acknowledgeLastIncomingCdmaSms(boolean success, Message response);
+ void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response);
/**
* parameters equivilient to 27.007 AT+CRSM command
@@ -1072,6 +1095,12 @@ public interface CommandsInterface {
*/
void setSmscAddress(String address, Message result);
+ /**
+ * Indicates whether there is storage available for new SMS messages.
+ * @param available true if storage is available
+ * @param result callback message
+ */
+ void reportSmsMemoryStatus(boolean available, Message result);
void invokeOemRilRequestRaw(byte[] data, Message response);
@@ -1244,7 +1273,9 @@ public interface CommandsInterface {
public void getCdmaBroadcastConfig(Message result);
/**
- * Requests the radio's system selection module to exit emergency callback mode.
+ * Requests the radio's system selection module to exit emergency callback mode.
+ * This function should only be called from CDMAPHone.java.
+ *
* @param response callback message
*/
public void exitEmergencyCallbackMode(Message response);
diff --git a/telephony/java/com/android/internal/telephony/Connection.java b/telephony/java/com/android/internal/telephony/Connection.java
index c6bbf82fd308e..237974d0ce25d 100644
--- a/telephony/java/com/android/internal/telephony/Connection.java
+++ b/telephony/java/com/android/internal/telephony/Connection.java
@@ -72,6 +72,31 @@ public abstract class Connection {
public abstract String getAddress();
+ /**
+ * Gets cdma CNAP name associated with connection
+ * @return cnap name or null if unavailable
+ */
+ public String getCnapName() {
+ return null;
+ }
+
+ /**
+ * Get orignal dial string
+ * @return orignal dial string or null if unavailable
+ */
+ public String getOrigDialString(){
+ return null;
+ }
+
+ /**
+ * Gets cdma CNAP presentation associated with connection
+ * @return cnap name or null if unavailable
+ */
+
+ public int getCnapNamePresentation() {
+ return 0;
+ };
+
/**
* @return Call that owns this Connection, or null if none
*/
@@ -204,8 +229,14 @@ public abstract class Connection {
WILD, /* The post dial string playback is waiting for a
call to proceedAfterWildChar() */
COMPLETE, /* The post dial string playback is complete */
- CANCELLED /* The post dial string playback was cancelled
+ CANCELLED, /* The post dial string playback was cancelled
with cancelPostDial() */
+ PAUSE /* The post dial string playback is pausing for a
+ call to processNextPostDialChar*/
+ }
+
+ public void clearUserData(){
+ userData = null;
}
public abstract PostDialState getPostDialState();
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index cc6b452e54c81..6e6f64c160375 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -238,5 +238,10 @@ interface ITelephony {
*/
String getCdmaEriText();
+ /**
+ * Returns the unread count of voicemails
+ */
+ int getCountVoiceMessages();
+
}
diff --git a/telephony/java/com/android/internal/telephony/Phone.java b/telephony/java/com/android/internal/telephony/Phone.java
index 4d0cf41341c4d..260f662452097 100644
--- a/telephony/java/com/android/internal/telephony/Phone.java
+++ b/telephony/java/com/android/internal/telephony/Phone.java
@@ -102,6 +102,7 @@ public interface Phone {
static final String DATA_APN_KEY = "apn";
static final String DATA_IFACE_NAME_KEY = "iface";
static final String NETWORK_UNAVAILABLE_KEY = "networkUnvailable";
+ static final String PHONE_IN_ECM_STATE = "phoneinECMState";
/**
* APN types for data connections. These are usage categories for an APN
@@ -195,6 +196,24 @@ public interface Phone {
static final int TTY_MODE_HCO = 2;
static final int TTY_MODE_VCO = 3;
+ /**
+ * CDMA OTA PROVISION STATUS, the same as RIL_CDMA_OTA_Status in ril.h
+ */
+
+ public static final int CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED = 0;
+ public static final int CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED = 1;
+ public static final int CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED = 2;
+ public static final int CDMA_OTA_PROVISION_STATUS_SSD_UPDATED = 3;
+ public static final int CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED = 4;
+ public static final int CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED = 5;
+ public static final int CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED = 6;
+ public static final int CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED = 7;
+ public static final int CDMA_OTA_PROVISION_STATUS_COMMITTED = 8;
+ public static final int CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED = 9;
+ public static final int CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED = 10;
+ public static final int CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED = 11;
+
+
/**
* Get the current ServiceState. Use
* registerForServiceStateChanged to be informed of
@@ -273,7 +292,12 @@ public interface Phone {
String getActiveApn();
/**
- * Get current signal strength.
+ * Get current signal strength. No change notification available on this
+ * interface. Use PhoneStateNotifier or an equivalent.
+ * An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu).
+ * The following special values are defined:
getSimCard().registerForReady() for change notification.
@@ -760,9 +752,18 @@ public interface Phone {
void stopDtmf();
/**
- * Play a Burst of DTMF tone on the active call. Ignored if there is no active call.
+ * send burst DTMF tone, it can send the string as single character or multiple character
+ * ignore if there is no active call or not valid digits string.
+ * Valid digit means only includes characters ISO-LATIN characters 0-9, *, #
+ * The difference between sendDtmf and sendBurstDtmf is sendDtmf only sends one character,
+ * this api can send single character and multiple character, also, this api has response
+ * back to caller.
+ *
+ * @param dtmfString is string representing the dialing digit(s) in the active call
+ * @param onCompelte is the callback message when the action is processed by BP
+ *
*/
- void sendBurstDtmf(String dtmfString);
+ void sendBurstDtmf(String dtmfString, Message onComplete);
/**
* Sets the radio power on/off state (off is sometimes
@@ -826,6 +827,12 @@ public interface Phone {
*/
String getVoiceMailNumber();
+ /**
+ * Returns unread voicemail count. This count is shown when the voicemail
+ * notification is expanded.
+ */
+ int getCountVoiceMessages();
+
/**
* Returns the alpha tag associated with the voice mail number.
* If there is no alpha tag associated or the record is not yet available,
@@ -859,7 +866,7 @@ public interface Phone {
*
* @param commandInterfaceCFReason is one of the valid call forwarding
* CF_REASONS, as defined in
- * Broadcast Action: The emergency callback mode is entered.
- *
+ * Broadcast Action: The emergency callback mode is changed.
+ *
* You can not receive this through components declared
* in manifests, only by explicitly registering for it with
@@ -65,8 +67,8 @@ public class TelephonyIntents {
*
* Requires no permission.
*/
- public static final String ACTION_EMERGENCY_CALLBACK_MODE_ENTERED
- = "android.intent.action.EMERGENCY_CALLBACK_MODE";
+ public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
+ = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
/**
* Broadcast Action: The phone's signal strength has changed. The intent will have the
* following extra values: Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
+ * .
+ */
+ // TODO(Moto): What is the use case, who is interested in this?
+ public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
+ = "android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS";
+
+ /**
+ * Broadcast Action: The MDN changed during the CDMA OTA Process
+ * The intent will have the following extra values:
+ */
+ // TODO(Moto): Generally broadcast intents are for use to allow entities which
+ // may not know about each other to "communicate". This seems quite specific
+ // and maybe using the registrant style would be better.
+ public static final String ACTION_CDMA_OTA_MDN_CHANGED
+ = "android.intent.action.ACTION_MDN_STATE_CHANGED";
+
}
diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
index 453185f89bd97..4e8950fe1effa 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
@@ -98,4 +98,7 @@ public interface TelephonyProperties
*/
static String PROPERTY_DATA_NETWORK_TYPE = "gsm.network.type";
+ /** Indicate if phone is in emergency callback mode */
+ static final String PROPERTY_INECM_MODE = "ril.cdma.inecmmode";
+
}
diff --git a/telephony/java/com/android/internal/telephony/WapPushOverSms.java b/telephony/java/com/android/internal/telephony/WapPushOverSms.java
index 98899c903684e..c851bc1b0fde3 100644
--- a/telephony/java/com/android/internal/telephony/WapPushOverSms.java
+++ b/telephony/java/com/android/internal/telephony/WapPushOverSms.java
@@ -18,7 +18,6 @@ package com.android.internal.telephony;
import android.content.Context;
import android.content.Intent;
-import android.os.PowerManager;
import android.provider.Telephony.Sms.Intents;
import android.util.Config;
import android.util.Log;
@@ -34,7 +33,7 @@ public class WapPushOverSms {
private final Context mContext;
private WspTypeDecoder pduDecoder;
- private PowerManager.WakeLock mWakeLock;
+ private SMSDispatcher mSmsDispatcher;
/**
* Hold the wake lock for 5 seconds, which should be enough time for
@@ -42,10 +41,9 @@ public class WapPushOverSms {
*/
private final int WAKE_LOCK_TIMEOUT = 5000;
- public WapPushOverSms(Phone phone) {
-
+ public WapPushOverSms(Phone phone, SMSDispatcher smsDispatcher) {
+ mSmsDispatcher = smsDispatcher;
mContext = phone.getContext();
- createWakelock();
}
/**
@@ -184,7 +182,7 @@ public class WapPushOverSms {
intent.putExtra("pduType", pduType);
intent.putExtra("data", data);
- sendBroadcast(intent, "android.permission.RECEIVE_WAP_PUSH");
+ mSmsDispatcher.dispatch(intent, "android.permission.RECEIVE_WAP_PUSH");
}
private void dispatchWapPdu_PushCO(byte[] pdu, int transactionId, int pduType) {
@@ -194,7 +192,7 @@ public class WapPushOverSms {
intent.putExtra("pduType", pduType);
intent.putExtra("data", pdu);
- sendBroadcast(intent, "android.permission.RECEIVE_WAP_PUSH");
+ mSmsDispatcher.dispatch(intent, "android.permission.RECEIVE_WAP_PUSH");
}
private void dispatchWapPdu_MMS(byte[] pdu, int transactionId, int pduType, int dataIndex) {
@@ -209,20 +207,7 @@ public class WapPushOverSms {
intent.putExtra("pduType", pduType);
intent.putExtra("data", data);
- sendBroadcast(intent, "android.permission.RECEIVE_MMS");
- }
-
- private void createWakelock() {
- PowerManager pm = (PowerManager)mContext.getSystemService(Context.POWER_SERVICE);
- mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "WapPushOverSms");
- mWakeLock.setReferenceCounted(true);
- }
-
- private void sendBroadcast(Intent intent, String permission) {
- // Hold a wake lock for WAKE_LOCK_TIMEOUT seconds, enough to give any
- // receivers time to take their own wake locks.
- mWakeLock.acquire(WAKE_LOCK_TIMEOUT);
- mContext.sendBroadcast(intent, permission);
+ mSmsDispatcher.dispatch(intent, "android.permission.RECEIVE_MMS");
}
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
index 03f7f986da057..c0bfe5e6fd343 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -35,6 +35,7 @@ import android.text.TextUtils;
import android.util.Log;
import static com.android.internal.telephony.TelephonyProperties.PROPERTY_BASEBAND_VERSION;
+import static com.android.internal.telephony.TelephonyProperties.PROPERTY_INECM_MODE;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CommandsInterface;
@@ -54,9 +55,9 @@ import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.TelephonyProperties;
-import java.util.ArrayList;
import java.util.List;
-
+import java.util.Timer;
+import java.util.TimerTask;
/**
* {@hide}
*/
@@ -83,8 +84,21 @@ public class CDMAPhone extends PhoneBase {
// mEriFileLoadedRegistrants are informed after the ERI text has been loaded
private RegistrantList mEriFileLoadedRegistrants = new RegistrantList();
+
+ // mECMExitRespRegistrant is informed after the phone has been exited
+ //the emergency callback mode
+ //keep track of if phone is in emergency callback mode
+ private boolean mIsPhoneInECMState;
+ private Registrant mECMExitRespRegistrant;
private String mEsn;
private String mMeid;
+
+ // A runnable which is used to automatically exit from ECM after a period of time.
+ private Runnable mExitEcmRunnable = new Runnable() {
+ public void run() {
+ exitEmergencyCallbackMode();
+ }
+ };
Registrant mPostDialHandler;
@@ -122,13 +136,16 @@ public class CDMAPhone extends PhoneBase {
mCM.setOnCallRing(h, EVENT_CALL_RING, null);
mSST.registerForNetworkAttach(h, EVENT_REGISTERED_TO_NETWORK, null);
mCM.registerForNVReady(h, EVENT_NV_READY, null);
- mCM.registerForCdmaCallWaiting(h,EVENT_CDMA_CALL_WAITING,null);
- mCM.setEmergencyCallbackMode(h, EVENT_EMERGENCY_CALLBACK_MODE, null);
+ mCM.setEmergencyCallbackMode(h, EVENT_EMERGENCY_CALLBACK_MODE_ENTER, null);
//Change the system setting
SystemProperties.set(TelephonyProperties.CURRENT_ACTIVE_PHONE,
new Integer(RILConstants.CDMA_PHONE).toString());
+
+ // TODO(Moto): Is this needed to handle phone crashes and/or power cycling?
+ String inEcm=SystemProperties.get(PROPERTY_INECM_MODE, "false");
+ mIsPhoneInECMState = inEcm.equals("true");
}
public void dispose() {
@@ -143,7 +160,7 @@ public class CDMAPhone extends PhoneBase {
mSST.unregisterForNetworkAttach(h); //EVENT_REGISTERED_TO_NETWORK
mCM.unSetOnSuppServiceNotification(h);
mCM.unSetOnCallRing(h);
- mCM.unregisterForCdmaCallWaiting(h);
+
//Force all referenced classes to unregister their former registered events
mCT.dispose();
@@ -370,8 +387,8 @@ public class CDMAPhone extends PhoneBase {
return mRuimRecords.getMdnNumber();
}
- public String getMin() {
- return mRuimRecords.getMin();
+ public String getCdmaMIN() {
+ return mRuimRecords.getCdmaMin();
}
public void getCallWaiting(Message onComplete) {
@@ -434,7 +451,7 @@ public class CDMAPhone extends PhoneBase {
}
public void setOnPostDialCharacter(Handler h, int what, Object obj) {
- Log.e(LOG_TAG, "setOnPostDialCharacter: not possible in CDMA");
+ mPostDialHandler = new Registrant(h, what, obj);
}
public boolean handlePinMmi(String dialString) {
@@ -478,6 +495,30 @@ public class CDMAPhone extends PhoneBase {
mDataConnection.setDataOnRoamingEnabled(enable);
}
+ public void registerForCdmaOtaStatusChange(Handler h, int what, Object obj) {
+ mCM.registerForCdmaOtaProvision(h, what, obj);
+ }
+
+ public void unregisterForCdmaOtaStatusChange(Handler h) {
+ mCM.unregisterForCdmaOtaProvision(h);
+ }
+
+ public void setOnEcbModeExitResponse(Handler h, int what, Object obj) {
+ mECMExitRespRegistrant = new Registrant (h, what, obj);
+ }
+
+ public void unsetOnEcbModeExitResponse(Handler h) {
+ mECMExitRespRegistrant.clear();
+ }
+
+ public void registerForCallWaiting(Handler h, int what, Object obj) {
+ Log.e(LOG_TAG, "method registerForCallWaiting is NOT yet supported in CDMA");
+ }
+
+ public void unregisterForCallWaiting(Handler h) {
+ Log.e(LOG_TAG, "method unregisterForCallWaiting is NOT yet supported in CDMA");
+ }
+
public String getIpAddress(String apnType) {
return mDataConnection.getIpAddress();
}
@@ -565,7 +606,7 @@ public class CDMAPhone extends PhoneBase {
mCM.stopDtmf(null);
}
- public void sendBurstDtmf(String dtmfString) {
+ public void sendBurstDtmf(String dtmfString, Message onComplete) {
boolean check = true;
for (int itr = 0;itr < dtmfString.length(); itr++) {
if (!PhoneNumberUtils.is12Key(dtmfString.charAt(itr))) {
@@ -576,7 +617,7 @@ public class CDMAPhone extends PhoneBase {
}
}
if ((mCT.state == Phone.State.OFFHOOK)&&(check)) {
- mCM.sendBurstDtmf(dtmfString, null);
+ mCM.sendBurstDtmf(dtmfString, onComplete);
}
}
@@ -593,7 +634,7 @@ public class CDMAPhone extends PhoneBase {
}
public void setOutgoingCallerIdDisplay(int commandInterfaceCLIRMode, Message onComplete) {
- Log.e(LOG_TAG, "getAvailableNetworks: not possible in CDMA");
+ Log.e(LOG_TAG, "setOutgoingCallerIdDisplay: not possible in CDMA");
}
public void enableLocationUpdates() {
@@ -630,7 +671,14 @@ public class CDMAPhone extends PhoneBase {
//TODO: Where can we get this value has to be clarified with QC
//return mSIMRecords.getVoiceMailNumber();
// throw new RuntimeException();
- return "12345";
+ return "*86";
+ }
+
+ /* Returns Number of Voicemails
+ * @hide
+ */
+ public int getCountVoiceMessages() {
+ return mRuimRecords.getCountVoiceMessages();
}
public String getVoiceMailAlphaTag() {
@@ -648,7 +696,15 @@ public class CDMAPhone extends PhoneBase {
}
public boolean enableDataConnectivity() {
- return mDataConnection.setDataEnabled(true);
+
+ // block data activities when phone is in emergency callback mode
+ if (mIsPhoneInECMState) {
+ Intent intent = new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS);
+ ActivityManagerNative.broadcastStickyIntent(intent, null);
+ return false;
+ } else {
+ return mDataConnection.setDataEnabled(true);
+ }
}
public void disableLocationUpdates() {
@@ -691,7 +747,7 @@ public class CDMAPhone extends PhoneBase {
return null;
}
- /**
+ /**
* Notify any interested party of a Phone state change.
*/
/*package*/ void notifyPhoneStateChanged() {
@@ -736,6 +792,13 @@ public class CDMAPhone extends PhoneBase {
mUnknownConnectionRegistrants.notifyResult(this);
}
+ void sendEmergencyCallbackModeChange(){
+ //Send an Intent
+ Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
+ intent.putExtra(PHONE_IN_ECM_STATE, mIsPhoneInECMState);
+ ActivityManagerNative.broadcastStickyIntent(intent,null);
+ }
+
/*package*/ void
updateMessageWaitingIndicator(boolean mwi) {
// this also calls notifyMessageWaitingIndicator()
@@ -761,6 +824,51 @@ public class CDMAPhone extends PhoneBase {
mMmiCompleteRegistrants.notifyRegistrants(new AsyncResult(null, fc, null));
}
+
+ @Override
+ public void exitEmergencyCallbackMode() {
+ // Send a message which will invoke handleExitEmergencyCallbackMode
+ mCM.exitEmergencyCallbackMode(h.obtainMessage(EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE));
+ }
+
+ private void handleEnterEmergencyCallbackMode(Message msg) {
+ Log.d(LOG_TAG, "Event EVENT_EMERGENCY_CALLBACK_MODE Received");
+ // if phone is not in ECM mode, and it's changed to ECM mode
+ if (mIsPhoneInECMState == false) {
+ mIsPhoneInECMState = true;
+ // notify change
+ sendEmergencyCallbackModeChange();
+ setSystemProperty(PROPERTY_INECM_MODE, "true");
+
+ // Post this runnable so we will automatically exit
+ // if no one invokes exitEmergencyCallbackMode() directly.
+ // TODO(Moto): Get the delay a property so it can be adjusted
+ long delayInMillis = 300000; // 30,000 millis == 5 minutes
+ h.postDelayed(mExitEcmRunnable, delayInMillis);
+ }
+ }
+
+ private void handleExitEmergencyCallbackMode(Message msg) {
+ Log.d(LOG_TAG, "Event EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE Received");
+ AsyncResult ar = (AsyncResult)msg.obj;
+
+ // Remove pending exit ECM runnable, if any
+ h.removeCallbacks(mExitEcmRunnable);
+
+ if (mECMExitRespRegistrant != null) {
+ mECMExitRespRegistrant.notifyRegistrant(ar);
+ }
+ // if exiting ecm success
+ if (ar.exception == null) {
+ if (mIsPhoneInECMState) {
+ mIsPhoneInECMState = false;
+ setSystemProperty(PROPERTY_INECM_MODE, "false");
+ }
+ // send an Intent
+ sendEmergencyCallbackModeChange();
+ }
+ }
+
//***** Inner Classes
class MyHandler extends Handler {
MyHandler() {
@@ -770,6 +878,7 @@ public class CDMAPhone extends PhoneBase {
super(l);
}
+ @Override
public void handleMessage(Message msg) {
AsyncResult ar;
Message onComplete;
@@ -806,12 +915,16 @@ public class CDMAPhone extends PhoneBase {
}
break;
- case EVENT_EMERGENCY_CALLBACK_MODE: {
- Log.d(LOG_TAG, "Event EVENT_EMERGENCY_CALLBACK_MODE Received");
- Intent intent =
- new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_ENTERED);
- ActivityManagerNative.broadcastStickyIntent(intent, null);
+ case EVENT_EMERGENCY_CALLBACK_MODE_ENTER:{
+ handleEnterEmergencyCallbackMode(msg);
}
+ break;
+
+ case EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE:{
+ handleExitEmergencyCallbackMode(msg);
+ }
+ break;
+
case EVENT_RUIM_RECORDS_LOADED:{
Log.d(LOG_TAG, "Event EVENT_RUIM_RECORDS_LOADED Received");
}
@@ -852,11 +965,7 @@ public class CDMAPhone extends PhoneBase {
Log.d(LOG_TAG, "ERI read, notify registrants");
mEriFileLoadedRegistrants.notifyRegistrants();
}
- }
- break;
-
- case EVENT_CDMA_CALL_WAITING:{
- Log.d(LOG_TAG, "Event EVENT_CDMA_CALL_WAITING Received");
+ setSystemProperty(PROPERTY_INECM_MODE,"false");
}
break;
@@ -867,26 +976,26 @@ public class CDMAPhone extends PhoneBase {
}
}
- /**
- * Retrieves the PhoneSubInfo of the CDMAPhone
- */
- public PhoneSubInfo getPhoneSubInfo(){
+ /**
+ * Retrieves the PhoneSubInfo of the CDMAPhone
+ */
+ public PhoneSubInfo getPhoneSubInfo() {
return mSubInfo;
- }
+ }
- /**
- * Retrieves the IccSmsInterfaceManager of the CDMAPhone
- */
- public IccSmsInterfaceManager getIccSmsInterfaceManager(){
- return mRuimSmsInterfaceManager;
- }
+ /**
+ * Retrieves the IccSmsInterfaceManager of the CDMAPhone
+ */
+ public IccSmsInterfaceManager getIccSmsInterfaceManager() {
+ return mRuimSmsInterfaceManager;
+ }
- /**
- * Retrieves the IccPhoneBookInterfaceManager of the CDMAPhone
- */
- public IccPhoneBookInterfaceManager getIccPhoneBookInterfaceManager(){
- return mRuimPhoneBookInterfaceManager;
- }
+ /**
+ * Retrieves the IccPhoneBookInterfaceManager of the CDMAPhone
+ */
+ public IccPhoneBookInterfaceManager getIccPhoneBookInterfaceManager() {
+ return mRuimPhoneBookInterfaceManager;
+ }
public void registerForNvLoaded(Handler h, int what, Object obj) {
Registrant r = new Registrant (h, what, obj);
@@ -906,97 +1015,146 @@ public class CDMAPhone extends PhoneBase {
mEriFileLoadedRegistrants.remove(h);
}
- // override for allowing access from other classes of this package
- /**
- * {@inheritDoc}
- */
- public final void setSystemProperty(String property, String value) {
- super.setSystemProperty(property, value);
- }
-
- /**
- * {@inheritDoc}
- */
- public Handler getHandler(){
- return h;
- }
-
- /**
- * {@inheritDoc}
- */
- public IccFileHandler getIccFileHandler(){
- return this.mIccFileHandler;
- }
-
- /**
- * Set the TTY mode of the CDMAPhone
- */
- public void setTTYMode(int ttyMode, Message onComplete) {
- this.mCM.setTTYMode(ttyMode, onComplete);
-}
-
- /**
- * Queries the TTY mode of the CDMAPhone
- */
- public void queryTTYMode(Message onComplete) {
- this.mCM.queryTTYMode(onComplete);
- }
-
- /**
- * Sends Exit EmergencyCallbackMode Exit request on CDMAPhone
- */
- public void exitEmergencyCallbackMode(Message onComplete) {
- this.mCM.exitEmergencyCallbackMode(onComplete);
- }
-
- /**
- * Activate or deactivate cell broadcast SMS.
- *
- * @param activate
- * 0 = activate, 1 = deactivate
- * @param response
- * Callback message is empty on completion
- */
- public void activateCellBroadcastSms(int activate, Message response) {
- mSMS.activateCellBroadcastSms(activate, response);
- }
-
- /**
- * Query the current configuration of cdma cell broadcast SMS.
- *
- * @param response
- * Callback message is empty on completion
- */
- public void getCellBroadcastSmsConfig(Message response){
- mSMS.getCellBroadcastSmsConfig(response);
- }
-
- /**
- * Configure cdma cell broadcast SMS.
- *
- * @param response
- * Callback message is empty on completion
- */
- public void setCellBroadcastSmsConfig(int[] configValuesArray, Message response){
- mSMS.setCellBroadcastConfig(configValuesArray, response);
- }
-
- public void registerForOtaSessionStatus(Handler h, int what, Object obj){
- mCM.registerForOtaSessionStatus(h, what, obj);
- }
-
- public void unregisterForOtaSessionStatus(Handler h){
- mCM.unregisterForOtaSessionStatus(h);
- }
-
-/**
- * TODO(Teleca): The code in getCdmaEriIconIndex, getCdmaEriIconMode & getCdmaEriText share a
- * lot of logic, refactor.
- */
+ // override for allowing access from other classes of this package
/**
- * Returns the CDMA ERI icon index to display,
- * it returns 1, EriInfo.ROAMING_INDICATOR_OFF, in case there is no icon to display
+ * {@inheritDoc}
*/
+ public final void setSystemProperty(String property, String value) {
+ super.setSystemProperty(property, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Handler getHandler() {
+ return h;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IccFileHandler getIccFileHandler() {
+ return this.mIccFileHandler;
+ }
+
+ /**
+ * Set the TTY mode of the CDMAPhone
+ */
+ public void setTTYMode(int ttyMode, Message onComplete) {
+ this.mCM.setTTYMode(ttyMode, onComplete);
+ }
+
+ /**
+ * Queries the TTY mode of the CDMAPhone
+ */
+ public void queryTTYMode(Message onComplete) {
+ this.mCM.queryTTYMode(onComplete);
+ }
+
+ /**
+ * Activate or deactivate cell broadcast SMS.
+ *
+ * @param activate 0 = activate, 1 = deactivate
+ * @param response Callback message is empty on completion
+ */
+ public void activateCellBroadcastSms(int activate, Message response) {
+ mSMS.activateCellBroadcastSms(activate, response);
+ }
+
+ /**
+ * Query the current configuration of cdma cell broadcast SMS.
+ *
+ * @param response Callback message is empty on completion
+ */
+ public void getCellBroadcastSmsConfig(Message response) {
+ mSMS.getCellBroadcastSmsConfig(response);
+ }
+
+ /**
+ * Configure cdma cell broadcast SMS.
+ *
+ * @param response Callback message is empty on completion
+ */
+ public void setCellBroadcastSmsConfig(int[] configValuesArray, Message response) {
+ mSMS.setCellBroadcastConfig(configValuesArray, response);
+ }
+
+ public static final String IS683A_FEATURE_CODE = "*228" ;
+ public static final int IS683A_FEATURE_CODE_NUM_DIGITS = 4 ;
+ public static final int IS683A_SYS_SEL_CODE_NUM_DIGITS = 2 ;
+ public static final int IS683A_SYS_SEL_CODE_OFFSET = 4;
+
+ private static final int IS683_CONST_800MHZ_A_BAND = 0;
+ private static final int IS683_CONST_800MHZ_B_BAND = 1;
+ private static final int IS683_CONST_1900MHZ_A_BLOCK = 2;
+ private static final int IS683_CONST_1900MHZ_B_BLOCK = 3;
+ private static final int IS683_CONST_1900MHZ_C_BLOCK = 4;
+ private static final int IS683_CONST_1900MHZ_D_BLOCK = 5;
+ private static final int IS683_CONST_1900MHZ_E_BLOCK = 6;
+ private static final int IS683_CONST_1900MHZ_F_BLOCK = 7;
+
+ private boolean isIs683OtaSpDialStr(String dialStr) {
+ int sysSelCodeInt;
+ boolean isOtaspDialString = false;
+ int dialStrLen = dialStr.length();
+
+ if (dialStrLen == IS683A_FEATURE_CODE_NUM_DIGITS) {
+ if (dialStr.equals(IS683A_FEATURE_CODE)) {
+ isOtaspDialString = true;
+ }
+ } else if ((dialStr.regionMatches(0, IS683A_FEATURE_CODE, 0,
+ IS683A_FEATURE_CODE_NUM_DIGITS) == true)
+ && (dialStrLen >=
+ (IS683A_FEATURE_CODE_NUM_DIGITS + IS683A_SYS_SEL_CODE_NUM_DIGITS))) {
+ StringBuilder sb = new StringBuilder(dialStr);
+ // Separate the System Selection Code into its own string
+ char[] sysSel = new char[2];
+ sb.delete(0, IS683A_SYS_SEL_CODE_OFFSET);
+ sb.getChars(0, IS683A_SYS_SEL_CODE_NUM_DIGITS, sysSel, 0);
+
+ if ((PhoneNumberUtils.isISODigit(sysSel[0]))
+ && (PhoneNumberUtils.isISODigit(sysSel[1]))) {
+ String sysSelCode = new String(sysSel);
+ sysSelCodeInt = Integer.parseInt((String)sysSelCode);
+ switch (sysSelCodeInt) {
+ case IS683_CONST_800MHZ_A_BAND:
+ case IS683_CONST_800MHZ_B_BAND:
+ case IS683_CONST_1900MHZ_A_BLOCK:
+ case IS683_CONST_1900MHZ_B_BLOCK:
+ case IS683_CONST_1900MHZ_C_BLOCK:
+ case IS683_CONST_1900MHZ_D_BLOCK:
+ case IS683_CONST_1900MHZ_E_BLOCK:
+ case IS683_CONST_1900MHZ_F_BLOCK:
+ isOtaspDialString = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ return isOtaspDialString;
+ }
+
+ /**
+ * isOTASPNumber: checks a given number against the IS-683A OTASP dial string and carrier
+ * OTASP dial string.
+ *
+ * @param dialStr the number to look up.
+ * @return true if the number is in IS-683A OTASP dial string or carrier OTASP dial string
+ */
+ @Override
+ public boolean isOtaSpNumber(String dialStr){
+ boolean isOtaSpNum = false;
+ if(dialStr != null){
+ isOtaSpNum=isIs683OtaSpDialStr(dialStr);
+ if(isOtaSpNum == false){
+ //TO DO:Add carrier specific OTASP number detection here.
+ }
+ }
+ return isOtaSpNum;
+ }
+
@Override
public int getCdmaEriIconIndex() {
int roamInd = getServiceState().getCdmaRoamingIndicator();
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
index a1d362fb600f5..c02fcd4a3a8e2 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
@@ -24,6 +24,7 @@ import android.os.RegistrantList;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.util.Log;
+import android.os.SystemProperties;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallTracker;
@@ -31,11 +32,12 @@ import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.DriverCall;
import com.android.internal.telephony.Phone;
-import com.android.internal.telephony.PhoneProxy;
+import com.android.internal.telephony.TelephonyProperties;
import java.util.ArrayList;
import java.util.List;
+
/**
* {@hide}
*/
@@ -69,11 +71,12 @@ public final class CdmaCallTracker extends CallTracker {
CdmaConnection pendingMO;
boolean hangupPendingMO;
-
+ boolean pendingCallInECM=false;
CDMAPhone phone;
boolean desiredMute = false; // false = mute off
+ int pendingCallClirMode;
Phone.State state = Phone.State.IDLE;
@@ -115,6 +118,7 @@ public final class CdmaCallTracker extends CallTracker {
}
+ @Override
protected void finalize() {
Log.d(LOG_TAG, "CdmaCallTracker finalized");
}
@@ -204,7 +208,15 @@ public final class CdmaCallTracker extends CallTracker {
// Always unmute when initiating a new call
setMute(false);
- cm.dial(pendingMO.address, clirMode, obtainCompleteMessage());
+ String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
+ if(inEcm.equals("false")) {
+ cm.dial(pendingMO.address, clirMode, obtainCompleteMessage());
+ } else {
+ phone.exitEmergencyCallbackMode();
+ phone.setOnEcbModeExitResponse(this,EVENT_EXIT_ECM_RESPONSE_CDMA, null);
+ pendingCallClirMode=clirMode;
+ pendingCallInECM=true;
+ }
}
updatePhoneState();
@@ -536,6 +548,9 @@ public final class CdmaCallTracker extends CallTracker {
droppedDuringPoll.add(pendingMO);
pendingMO = null;
hangupPendingMO = false;
+ if( pendingCallInECM) {
+ pendingCallInECM = false;
+ }
}
if (newRinging != null) {
@@ -847,8 +862,17 @@ public final class CdmaCallTracker extends CallTracker {
handleRadioNotAvailable();
break;
+ case EVENT_EXIT_ECM_RESPONSE_CDMA:
+ //no matter the result, we still do the same here
+ if (pendingCallInECM) {
+ cm.dial(pendingMO.address, pendingCallClirMode, obtainCompleteMessage());
+ pendingCallInECM = false;
+ }
+ phone.unsetOnEcbModeExitResponse(this);
+ break;
+
default:{
- throw new RuntimeException("unexpected event not handled");
+ throw new RuntimeException("unexpected event not handled");
}
}
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaCallWaiting.java b/telephony/java/com/android/internal/telephony/cdma/CdmaCallWaiting.java
deleted file mode 100644
index 64841d7ed0328..0000000000000
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaCallWaiting.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telephony.cdma;
-
-import com.android.internal.telephony.CdmaInformationRecord;
-
-public class CdmaCallWaiting {
- public String number;
- public int numberPresentation;
- public String name;
-
- public CdmaInformationRecord.CdmaSignalInfoRec signalInfoRecord =
- new CdmaInformationRecord.CdmaSignalInfoRec();
-
- @Override
- public String toString() {
- return "CdmaCallWaiting: {" + " number: " + number + " numberPresentation: "
- + numberPresentation + " name: " + name + " signalInfoRecord: "
- + signalInfoRecord + " }";
- }
-}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaCallWaitingNotification.java b/telephony/java/com/android/internal/telephony/cdma/CdmaCallWaitingNotification.java
new file mode 100644
index 0000000000000..54dec48e84354
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaCallWaitingNotification.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.telephony.cdma;
+
+/**
+ * Represents a Supplementary Service Notification received from the network.
+ *
+ * {@hide}
+ */
+public class CdmaCallWaitingNotification {
+ public String number =null;
+ public int numberPresentation = 0;
+ public String name = null;
+ public int namePresentation = 0;
+ public int isPresent = 0;
+ public int signalType = 0;
+ public int alertPitch = 0;
+ public int signal = 0;
+
+
+ public String toString()
+ {
+ return super.toString() + "Call Waiting Notification "
+ + " number: " + number
+ + " numberPresentation: " + numberPresentation
+ + " name: " + name
+ + " namePresentation: " + namePresentation
+ + " isPresent: " + isPresent
+ + " signalType: " + signalType
+ + " alertPitch: " + alertPitch
+ + " signal: " + signal ;
+ }
+
+}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
index 0a237c6fb942c..32442f60a0b30 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
@@ -48,7 +48,7 @@ public class CdmaConnection extends Connection {
String postDialString; // outgoing calls only
boolean isIncoming;
boolean disconnected;
-
+ String cnapName;
int index; // index in CdmaCallTracker.connections[], -1 if unassigned
/*
@@ -74,6 +74,8 @@ public class CdmaConnection extends Connection {
DisconnectCause cause = DisconnectCause.NOT_DISCONNECTED;
PostDialState postDialState = PostDialState.NOT_STARTED;
int numberPresentation = Connection.PRESENTATION_ALLOWED;
+ int cnapNamePresentation = Connection.PRESENTATION_ALLOWED;
+
Handler h;
@@ -86,10 +88,19 @@ public class CdmaConnection extends Connection {
static final int EVENT_WAKE_LOCK_TIMEOUT = 4;
//***** Constants
- static final int PAUSE_DELAY_FIRST_MILLIS = 100;
- static final int PAUSE_DELAY_MILLIS = 3 * 1000;
static final int WAKE_LOCK_TIMEOUT_MILLIS = 60*1000;
-
+ static final int PAUSE_DELAY_MILLIS = 2 * 1000;
+
+ // TODO(Moto): These should be come from a resourse file
+ // at a minimum as different carriers may want to use
+ // different characters and our general default is "," & ";".
+ // Furthermore Android supports contacts that have phone
+ // numbers entered as strings so '1-800-164flowers' would not
+ // be handled as expected. Both issues need to be resolved.
+ static final char CUSTOMERIZED_WAIT_CHAR_UPPER ='W';
+ static final char CUSTOMERIZED_WAIT_CHAR_LOWER ='w';
+ static final char CUSTOMERIZED_PAUSE_CHAR_UPPER ='P';
+ static final char CUSTOMERIZED_PAUSE_CHAR_LOWER ='p';
//***** Inner Classes
class MyHandler extends Handler {
@@ -126,6 +137,8 @@ public class CdmaConnection extends Connection {
isIncoming = dc.isMT;
createTime = System.currentTimeMillis();
+ cnapName = dc.name;
+ cnapNamePresentation = dc.namePresentation;
numberPresentation = dc.numberPresentation;
this.index = index;
@@ -134,6 +147,16 @@ public class CdmaConnection extends Connection {
parent.attach(this, dc);
}
+ CdmaConnection () {
+ owner = null;
+ h = null;
+ address = null;
+ index = -1;
+ parent = null;
+ isIncoming = true;
+ createTime = System.currentTimeMillis();
+ }
+
/** This is an MO call, created when dialing */
/*package*/
CdmaConnection (Context context, String dialString, CdmaCallTracker ct, CdmaCall parent) {
@@ -144,6 +167,9 @@ public class CdmaConnection extends Connection {
h = new MyHandler(owner.getLooper());
this.dialString = dialString;
+ Log.d(LOG_TAG, "[CDMAConn] CdmaConnection: dialString=" + dialString);
+ dialString = formatDialString(dialString);
+ Log.d(LOG_TAG, "[CDMAConn] CdmaConnection:formated dialString=" + dialString);
this.address = PhoneNumberUtils.extractNetworkPortion(dialString);
this.postDialString = PhoneNumberUtils.extractPostDialPortion(dialString);
@@ -151,10 +177,15 @@ public class CdmaConnection extends Connection {
index = -1;
isIncoming = false;
+ cnapName = null;
+ cnapNamePresentation = 0;
+ numberPresentation = 0;
createTime = System.currentTimeMillis();
- this.parent = parent;
- parent.attachFake(this, CdmaCall.State.DIALING);
+ if (parent != null) {
+ this.parent = parent;
+ parent.attachFake(this, CdmaCall.State.DIALING);
+ }
}
public void dispose() {
@@ -186,10 +217,22 @@ public class CdmaConnection extends Connection {
return (isIncoming ? "incoming" : "outgoing");
}
+ public String getOrigDialString(){
+ return dialString;
+ }
+
public String getAddress() {
return address;
}
+ public String getCnapName() {
+ return cnapName;
+ }
+
+ public int getCnapNamePresentation() {
+ return cnapNamePresentation;
+ }
+
public CdmaCall getCall() {
return parent;
}
@@ -320,6 +363,16 @@ public class CdmaConnection extends Connection {
}
}
+ /**
+ * Used for 3way call only
+ */
+ void update (CdmaConnection c) {
+ address = c.address;
+ cnapName = c.cnapName;
+ cnapNamePresentation = c.cnapNamePresentation;
+ numberPresentation = c.numberPresentation;
+ }
+
public void cancelPostDial() {
setPostDialState(PostDialState.CANCELLED);
}
@@ -355,7 +408,7 @@ public class CdmaConnection extends Connection {
case CallFailCause.CDMA_LOCKED_UNTIL_POWER_CYCLE:
return DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE;
case CallFailCause.CDMA_DROP:
- return DisconnectCause.CDMA_DROP;
+ return DisconnectCause.LOST_SIGNAL; // TODO(Moto): wink/dave changed from CDMA_DROP;
case CallFailCause.CDMA_INTERCEPT:
return DisconnectCause.CDMA_INTERCEPT;
case CallFailCause.CDMA_REORDER:
@@ -434,6 +487,20 @@ public class CdmaConnection extends Connection {
changed = true;
}
+ // A null cnapName should be the same as ""
+ if (null != dc.name) {
+ if (cnapName != dc.name) {
+ cnapName = dc.name;
+ changed = true;
+ }
+ } else {
+ cnapName = "";
+ // TODO(Moto): Should changed = true if cnapName wasn't previously ""
+ }
+ log("--dssds----"+cnapName);
+ cnapNamePresentation = dc.namePresentation;
+ numberPresentation = dc.numberPresentation;
+
if (newParent != parent) {
if (parent != null) {
parent.detach(this);
@@ -533,25 +600,13 @@ public class CdmaConnection extends Connection {
if (PhoneNumberUtils.is12Key(c)) {
owner.cm.sendDtmf(c, h.obtainMessage(EVENT_DTMF_DONE));
} else if (c == PhoneNumberUtils.PAUSE) {
- // From TS 22.101:
+ setPostDialState(PostDialState.PAUSE);
- // "The first occurrence of the "DTMF Control Digits Separator"
- // shall be used by the ME to distinguish between the addressing
- // digits (i.e. the phone number) and the DTMF digits...."
-
- if (nextPostDialChar == 1) {
- // The first occurrence.
- // We don't need to pause here, but wait for just a bit anyway
- h.sendMessageDelayed(h.obtainMessage(EVENT_PAUSE_DONE),
- PAUSE_DELAY_FIRST_MILLIS);
- } else {
- // It continues...
- // "Upon subsequent occurrences of the separator, the UE shall
- // pause again for 3 seconds (\u00B1 20 %) before sending any
- // further DTMF digits."
- h.sendMessageDelayed(h.obtainMessage(EVENT_PAUSE_DONE),
+ // Upon occurrences of the separator, the UE shall
+ // pause again for 2 seconds before sending any
+ // further DTMF digits.
+ h.sendMessageDelayed(h.obtainMessage(EVENT_PAUSE_DONE),
PAUSE_DELAY_MILLIS);
- }
} else if (c == PhoneNumberUtils.WAIT) {
setPostDialState(PostDialState.WAIT);
} else if (c == PhoneNumberUtils.WILD) {
@@ -563,17 +618,40 @@ public class CdmaConnection extends Connection {
return true;
}
- public String
- getRemainingPostDialString() {
+ public String getRemainingPostDialString() {
if (postDialState == PostDialState.CANCELLED
- || postDialState == PostDialState.COMPLETE
- || postDialString == null
- || postDialString.length() <= nextPostDialChar
- ) {
+ || postDialState == PostDialState.COMPLETE
+ || postDialString == null
+ || postDialString.length() <= nextPostDialChar) {
return "";
}
- return postDialString.substring(nextPostDialChar);
+ String subStr = postDialString.substring(nextPostDialChar);
+ if (subStr != null) {
+ int wIndex = subStr.indexOf(PhoneNumberUtils.WAIT);
+ int pIndex = subStr.indexOf(PhoneNumberUtils.PAUSE);
+
+ // TODO(Moto): Courtesy of jsh; is this simpler expression equivalent?
+ //
+ // if (wIndex > 0 && (wIndex < pIndex || pIndex <= 0)) {
+ // subStr = subStr.substring(0, wIndex);
+ // } else if (pIndex > 0) {
+ // subStr = subStr.substring(0, pIndex);
+ // }
+
+ if (wIndex > 0 && pIndex > 0) {
+ if (wIndex > pIndex) {
+ subStr = subStr.substring(0, pIndex);
+ } else {
+ subStr = subStr.substring(0, wIndex);
+ }
+ } else if (wIndex > 0) {
+ subStr = subStr.substring(0, wIndex);
+ } else if (pIndex > 0) {
+ subStr = subStr.substring(0, pIndex);
+ }
+ }
+ return subStr;
}
@Override
@@ -591,8 +669,7 @@ public class CdmaConnection extends Connection {
releaseWakeLock();
}
- private void
- processNextPostDialChar() {
+ void processNextPostDialChar() {
char c = 0;
Registrant postDialHandler;
@@ -698,21 +775,18 @@ public class CdmaConnection extends Connection {
postDialState = s;
}
- private void
- createWakeLock(Context context) {
- PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
+ private void createWakeLock(Context context) {
+ PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
mPartialWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG);
}
- private void
- acquireWakeLock() {
+ private void acquireWakeLock() {
log("acquireWakeLock");
mPartialWakeLock.acquire();
}
- private void
- releaseWakeLock() {
- synchronized(mPartialWakeLock) {
+ private void releaseWakeLock() {
+ synchronized (mPartialWakeLock) {
if (mPartialWakeLock.isHeld()) {
log("releaseWakeLock");
mPartialWakeLock.release();
@@ -720,6 +794,119 @@ public class CdmaConnection extends Connection {
}
}
+ private static boolean isPause(char c) {
+ if (c == CUSTOMERIZED_PAUSE_CHAR_UPPER || c == CUSTOMERIZED_PAUSE_CHAR_LOWER
+ || c == PhoneNumberUtils.PAUSE) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private static boolean isWait(char c) {
+ if (c == CUSTOMERIZED_WAIT_CHAR_LOWER || c == CUSTOMERIZED_WAIT_CHAR_UPPER
+ || c == PhoneNumberUtils.WAIT) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * format string
+ * convert "+" to "011"
+ * handle corner cases for PAUSE/WAIT
+ * If PAUSE/WAIT sequence at the end,ignore them
+ * If PAUSE/WAIT sequence in the middle, then if there is any WAIT
+ * in PAUSE/WAIT sequence, treat them like WAIT
+ * If PAUSE followed by WAIT or WAIT followed by PAUSE in the middle,
+ * treat them like just PAUSE or WAIT
+ */
+ private static String formatDialString(String phoneNumber) {
+ if (phoneNumber == null) {
+ return null;
+ }
+ int length = phoneNumber.length();
+ StringBuilder ret = new StringBuilder();
+
+ // TODO(Moto): Modifying the for loop index is confusing, a
+ // while loop is probably better and overall this code is
+ // hard to follow. If this was routine was refactored and
+ // used several private methods with good names to make it
+ // easier to follow.
+ for (int i = 0; i < length; i++) {
+ char c = phoneNumber.charAt(i);
+
+ if (PhoneNumberUtils.isDialable(c)) {
+ if (c == '+') {
+ // TODO(Moto): Is this valid for "all" countries????
+ // should probably be pulled from a resource based
+ // on current contry code (MCC).
+ ret.append("011");
+ } else {
+ ret.append(c);
+ }
+ } else if (isPause(c) || isWait(c)) {
+ if (i < length - 1) { // if PAUSE/WAIT not at the end
+ int index = 0;
+ boolean wMatched = false;
+ for (index = i + 1; index < length; index++) {
+ char cNext = phoneNumber.charAt(index);
+ // if there is any W inside P/W sequence,mark it
+ if (isWait(cNext)) {
+ wMatched = true;
+ }
+ // if any characters other than P/W chars after P/W sequence
+ // we break out the loop and append the correct
+ if (!isWait(cNext) && !isPause(cNext)) {
+ break;
+ }
+ }
+ if (index == length) {
+ // it means there is no dialable character after PAUSE/WAIT
+ i = length - 1;
+ break;
+ } else {// means index com.android.internal.telephony.CommandsInterface./code>
+ * com.android.internal.telephony.CommandsInterface.
* @param onComplete a callback message when the action is completed.
* @see com.android.internal.telephony.CallForwardInfo for details.
*/
@@ -872,10 +879,10 @@ public interface Phone {
*
* @param commandInterfaceCFReason is one of the valid call forwarding
* CF_REASONS, as defined in
- * com.android.internal.telephony.CommandsInterface./code>
+ * com.android.internal.telephony.CommandsInterface.
* @param commandInterfaceCFAction is one of the valid call forwarding
* CF_ACTIONS, as defined in
- * com.android.internal.telephony.CommandsInterface./code>
+ * com.android.internal.telephony.CommandsInterface.
* @param dialingNumber is the target phone number to forward calls to
* @param timerSeconds is used by CFNRy to indicate the timeout before
* forwarding is attempted.
@@ -1335,10 +1342,16 @@ public interface Phone {
//***** CDMA support methods
+ /*
+ * TODO(Moto) TODO(Teleca): can getCdmaMin, getEsn, getMeid use more generic calls
+ * already defined getXxxx above?
+ */
+
/**
* Retrieves the MIN for CDMA phones.
*/
- String getMin();
+
+ String getCdmaMin();
/**
* Retrieves the ESN for CDMA phones.
@@ -1383,14 +1396,6 @@ public interface Phone {
*/
void queryTTYMode(Message onComplete);
- /**
- * exitEmergencyCallbackMode
- * exits the emergency callback mode
- *
- * @param onComplete a callback message when the action is completed.
- */
- void exitEmergencyCallbackMode(Message onComplete);
-
/**
* Activate or deactivate cell broadcast SMS.
*
@@ -1438,4 +1443,93 @@ public interface Phone {
*/
public String getCdmaEriText();
+ /**
+ * request to exit emergency call back mode
+ * the caller should use setOnECMModeExitResponse
+ * to receive the emergency callback mode exit response
+ */
+ void exitEmergencyCallbackMode();
+
+ /**
+ * this decides if the dial number is OTA(Over the air provision) number or not
+ * @param dialStr is string representing the dialing digit(s)
+ * @return true means the dialStr is OTA number, and false means the dialStr is not OTA number
+ */
+ boolean isOtaSpNumber(String dialStr);
+
+ /**
+ * Register for notifications when CDMA call waiting comes
+ *
+ * @param h Handler that receives the notification message.
+ * @param what User-defined message code.
+ * @param obj User object.
+ */
+ // TODO(Moto) TODO: Remove when generic implemented
+ void registerForCallWaiting(Handler h, int what, Object obj);
+
+ /**
+ * Unegister for notifications when CDMA Call waiting comes
+ * @param h Handler to be removed from the registrant list.
+ */
+ // TODO(Moto): Remove when generic implemented
+ void unregisterForCallWaiting(Handler h);
+
+
+ /**
+ * Register for signal information notifications from the network.
+ * Message.obj will contain an AsyncResult.
+ * AsyncResult.result will be a SuppServiceNotification instance.
+ *
+ * @param h Handler that receives the notification message.
+ * @param what User-defined message code.
+ * @param obj User object.
+ */
+
+ void registerForSignalInfo(Handler h, int what, Object obj) ;
+ /**
+ * Unregisters for signal information notifications.
+ * Extraneous calls are tolerated silently
+ *
+ * @param h Handler to be removed from the registrant list.
+ */
+ void unregisterForSignalInfo(Handler h);
+
+ /**
+ * Register for display information notifications from the network.
+ * Message.obj will contain an AsyncResult.
+ * AsyncResult.result will be a SuppServiceNotification instance.
+ *
+ * @param h Handler that receives the notification message.
+ * @param what User-defined message code.
+ * @param obj User object.
+ */
+ void registerForDisplayInfo(Handler h, int what, Object obj);
+
+ /**
+ * Unregisters for display information notifications.
+ * Extraneous calls are tolerated silently
+ *
+ * @param h Handler to be removed from the registrant list.
+ */
+ void unregisterForDisplayInfo(Handler h) ;
+
+
+ /**
+ * registers for exit emergency call back mode request response
+ *
+ * @param h Handler that receives the notification message.
+ * @param what User-defined message code.
+ * @param obj User object.
+ */
+
+ void setOnEcbModeExitResponse(Handler h, int what, Object obj);
+
+ /**
+ * Unregisters for exit emergency call back mode request response
+ *
+ * @param h Handler to be removed from the registrant list.
+ */
+ void unsetOnEcbModeExitResponse(Handler h);
+
+
}
diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java
index 2849988c3ce4d..ebba09273a8fd 100644
--- a/telephony/java/com/android/internal/telephony/PhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/PhoneBase.java
@@ -102,8 +102,8 @@ public abstract class PhoneBase implements Phone {
protected static final int EVENT_RUIM_RECORDS_LOADED = 21;
protected static final int EVENT_NV_READY = 22;
protected static final int EVENT_SET_ENHANCED_VP = 23;
- protected static final int EVENT_CDMA_CALL_WAITING = 24;
- protected static final int EVENT_EMERGENCY_CALLBACK_MODE = 25;
+ protected static final int EVENT_EMERGENCY_CALLBACK_MODE_ENTER = 24;
+ protected static final int EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE = 25;
// Key used to read/write current CLIR setting
public static final String CLIR_KEY = "clir_key";
@@ -296,36 +296,6 @@ public abstract class PhoneBase implements Phone {
mCM.unregisterForInCallVoicePrivacyOff(h);
}
- // Inherited documentation suffices.
- public void registerForOtaStatusChange(Handler h, int what, Object obj){
- mCM.registerForOtaSessionStatus(h,what,obj);
- }
-
- // Inherited documentation suffices.
- public void unregisterForOtaStatusChange(Handler h){
- mCM.unregisterForOtaSessionStatus(h);
- }
-
- // Inherited documentation suffices.
- public void registerCdmaInformationRecord(Handler h, int what, Object obj){
- mCM.registerCdmaInformationRecord(h,what,obj);
- }
-
- // Inherited documentation suffices.
- public void unregisterCdmaInformationRecord(Handler h){
- mCM.unregisterCdmaInformationRecord(h);
- }
-
- // Inherited documentation suffices.
- public void registerForCdmaCallWaiting(Handler h, int what, Object obj){
- mCM.registerForCdmaCallWaiting(h,what,obj);
- }
-
- // Inherited documentation suffices.
- public void unregisterForCdmaCallWaiting(Handler h){
- mCM.unregisterForCdmaCallWaiting(h);
- }
-
/**
* Notifiy registrants of a new ringing Connection.
* Subclasses of Phone probably want to replace this with a
@@ -650,14 +620,6 @@ public abstract class PhoneBase implements Phone {
Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
}
- /**
- * Send the exit emergency callback mode message
- */
- public void exitEmergencyCallbackMode(Message onComplete) {
- // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
- Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
- }
-
/**
* This should only be called in GSM mode.
* Only here for some backward compatibility
@@ -704,6 +666,11 @@ public abstract class PhoneBase implements Phone {
public abstract String getPhoneName();
+ /** @hide */
+ public int getCountVoiceMessages(){
+ return 0;
+ }
+
/**
* Returns the CDMA ERI icon index to display
*/
@@ -730,4 +697,71 @@ public abstract class PhoneBase implements Phone {
return "GSM nw, no ERI";
}
+ public String getCdmaMin() {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ return null;
+ }
+
+ public void sendBurstDtmf(String dtmfString, Message onComplete) {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
+ public void exitEmergencyCallbackMode() {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
+ public void registerForCdmaOtaStatusChange(Handler h, int what, Object obj) {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
+ public void unregisterForCdmaOtaStatusChange(Handler h) {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
+ public boolean isOtaSpNumber(String dialStr) {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ return false;
+ }
+
+ public void registerForCallWaiting(Handler h, int what, Object obj){
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
+ public void unregisterForCallWaiting(Handler h){
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
+ public void registerForSignalInfo(Handler h, int what, Object obj) {
+ mCM.registerForSignalInfo(h, what, obj);
+ }
+
+ public void unregisterForSignalInfo(Handler h) {
+ mCM.unregisterForSignalInfo(h);
+ }
+
+ public void registerForDisplayInfo(Handler h, int what, Object obj) {
+ mCM.registerForDisplayInfo(h, what, obj);
+ }
+
+ public void unregisterForDisplayInfo(Handler h) {
+ mCM.unregisterForDisplayInfo(h);
+ }
+
+ public void setOnEcbModeExitResponse(Handler h, int what, Object obj){
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
+ public void unsetOnEcbModeExitResponse(Handler h){
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/PhoneProxy.java b/telephony/java/com/android/internal/telephony/PhoneProxy.java
index a329cbbaac2c1..7d968f97e5e06 100644
--- a/telephony/java/com/android/internal/telephony/PhoneProxy.java
+++ b/telephony/java/com/android/internal/telephony/PhoneProxy.java
@@ -306,28 +306,12 @@ public class PhoneProxy extends Handler implements Phone {
mActivePhone.unregisterForInCallVoicePrivacyOff(h);
}
- public void registerCdmaInformationRecord(Handler h, int what, Object obj) {
- mActivePhone.registerCdmaInformationRecord(h,what,obj);
+ public void registerForCdmaOtaStatusChange(Handler h, int what, Object obj) {
+ mActivePhone.registerForCdmaOtaStatusChange(h,what,obj);
}
- public void unregisterCdmaInformationRecord(Handler h) {
- mActivePhone.unregisterCdmaInformationRecord(h);
- }
-
- public void registerForOtaStatusChange(Handler h, int what, Object obj){
- mActivePhone.registerForOtaStatusChange(h,what,obj);
- }
-
- public void unregisterForOtaStatusChange(Handler h){
- mActivePhone.unregisterForOtaStatusChange(h);
- }
-
- public void registerForCdmaCallWaiting(Handler h, int what, Object obj){
- mActivePhone.registerForCdmaCallWaiting(h,what,obj);
- }
-
- public void unregisterForCdmaCallWaiting(Handler h){
- mActivePhone.unregisterForCdmaCallWaiting(h);
+ public void unregisterForCdmaOtaStatusChange(Handler h) {
+ mActivePhone.unregisterForCdmaOtaStatusChange(h);
}
public boolean getIccRecordsLoaded() {
@@ -414,10 +398,6 @@ public class PhoneProxy extends Handler implements Phone {
mActivePhone.stopDtmf();
}
- public void sendBurstDtmf(String dtmfString) {
- mActivePhone.sendBurstDtmf(dtmfString);
- }
-
public void setRadioPower(boolean power) {
mActivePhone.setRadioPower(power);
}
@@ -434,6 +414,10 @@ public class PhoneProxy extends Handler implements Phone {
return mActivePhone.getLine1Number();
}
+ public String getCdmaMin() {
+ return mActivePhone.getCdmaMin();
+ }
+
public String getLine1AlphaTag() {
return mActivePhone.getLine1AlphaTag();
}
@@ -446,6 +430,11 @@ public class PhoneProxy extends Handler implements Phone {
return mActivePhone.getVoiceMailNumber();
}
+ /** @hide */
+ public int getCountVoiceMessages(){
+ return mActivePhone.getCountVoiceMessages();
+ }
+
public String getVoiceMailAlphaTag() {
return mActivePhone.getVoiceMailAlphaTag();
}
@@ -656,10 +645,6 @@ public class PhoneProxy extends Handler implements Phone {
return mActivePhone.getIccSerialNumber();
}
- public String getMin() {
- return mActivePhone.getMin();
- }
-
public String getEsn() {
return mActivePhone.getEsn();
}
@@ -688,10 +673,6 @@ public class PhoneProxy extends Handler implements Phone {
mActivePhone.queryTTYMode(onComplete);
}
- public void exitEmergencyCallbackMode(Message onComplete) {
- mActivePhone.exitEmergencyCallbackMode(onComplete);
- }
-
public void activateCellBroadcastSms(int activate, Message response) {
mActivePhone.activateCellBroadcastSms(activate, response);
}
@@ -720,12 +701,55 @@ public class PhoneProxy extends Handler implements Phone {
return mActivePhone.getCdmaEriIconIndex();
}
+ public String getCdmaEriText() {
+ return mActivePhone.getCdmaEriText();
+ }
+
public int getCdmaEriIconMode() {
return mActivePhone.getCdmaEriIconMode();
}
- public String getCdmaEriText() {
- return mActivePhone.getCdmaEriText();
+ public void sendBurstDtmf(String dtmfString, Message onComplete){
+ mActivePhone.sendBurstDtmf(dtmfString,onComplete);
+ }
+
+ public void exitEmergencyCallbackMode(){
+ mActivePhone.exitEmergencyCallbackMode();
+ }
+
+ public boolean isOtaSpNumber(String dialStr){
+ return mActivePhone.isOtaSpNumber(dialStr);
+ }
+
+ public void registerForCallWaiting(Handler h, int what, Object obj){
+ mActivePhone.registerForCallWaiting(h,what,obj);
+ }
+
+ public void unregisterForCallWaiting(Handler h){
+ mActivePhone.unregisterForCallWaiting(h);
+ }
+
+ public void registerForSignalInfo(Handler h, int what, Object obj) {
+ mActivePhone.registerForSignalInfo(h,what,obj);
+ }
+
+ public void unregisterForSignalInfo(Handler h) {
+ mActivePhone.unregisterForSignalInfo(h);
+ }
+
+ public void registerForDisplayInfo(Handler h, int what, Object obj) {
+ mActivePhone.registerForDisplayInfo(h,what,obj);
+ }
+
+ public void unregisterForDisplayInfo(Handler h) {
+ mActivePhone.unregisterForDisplayInfo(h);
+ }
+
+ public void setOnEcbModeExitResponse(Handler h, int what, Object obj){
+ mActivePhone.setOnEcbModeExitResponse(h,what,obj);
+ }
+
+ public void unsetOnEcbModeExitResponse(Handler h){
+ mActivePhone.unsetOnEcbModeExitResponse(h);
}
}
-
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java
index 070d233bbdb66..ea84b09801e45 100644
--- a/telephony/java/com/android/internal/telephony/RIL.java
+++ b/telephony/java/com/android/internal/telephony/RIL.java
@@ -38,11 +38,18 @@ import android.telephony.SmsMessage;
import android.util.Config;
import android.util.Log;
-import com.android.internal.telephony.CdmaInformationRecord;
-import com.android.internal.telephony.cdma.CdmaCallWaiting;
+import com.android.internal.telephony.CallForwardInfo;
+import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.DataCallState;
import com.android.internal.telephony.gsm.NetworkInfo;
import com.android.internal.telephony.gsm.SuppServiceNotification;
+import com.android.internal.telephony.IccCardApplication;
+import com.android.internal.telephony.IccCardStatus;
+import com.android.internal.telephony.IccUtils;
+import com.android.internal.telephony.RILConstants;
+import com.android.internal.telephony.SmsResponse;
+import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
+import com.android.internal.telephony.cdma.CdmaInformationRecords;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
@@ -1063,10 +1070,11 @@ public final class RIL extends BaseCommands implements CommandsInterface {
sendBurstDtmf(String dtmfString, Message result) {
RILRequest rr = RILRequest.obtain(RIL_REQUEST_CDMA_BURST_DTMF, result);
- if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
-
rr.mp.writeString(dtmfString);
+ if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
+ + " : " + dtmfString);
+
send(rr);
}
@@ -1331,28 +1339,32 @@ public final class RIL extends BaseCommands implements CommandsInterface {
}
public void
- acknowledgeLastIncomingSMS(boolean success, Message result) {
+ acknowledgeLastIncomingGsmSms(boolean success, int cause, Message result) {
RILRequest rr
= RILRequest.obtain(RIL_REQUEST_SMS_ACKNOWLEDGE, result);
- rr.mp.writeInt(1);
+ rr.mp.writeInt(2);
rr.mp.writeInt(success ? 1 : 0);
+ rr.mp.writeInt(cause);
- if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
+ if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
+ + " " + success + " " + cause);
send(rr);
}
public void
- acknowledgeLastIncomingCdmaSms(boolean success, Message result) {
+ acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message result) {
RILRequest rr
= RILRequest.obtain(RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE, result);
+ rr.mp.writeInt(2);
rr.mp.writeInt(success ? 0 : 1); //RIL_CDMA_SMS_ErrorClass
// cause code according to X.S004-550E
- rr.mp.writeInt(39); //39 means other terminal problem; is not interpreted for success.
+ rr.mp.writeInt(cause);
- if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
+ if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
+ + " " + success + " " + cause);
send(rr);
}
@@ -1804,6 +1816,20 @@ public final class RIL extends BaseCommands implements CommandsInterface {
send(rr);
}
+ /**
+ * {@inheritDoc}
+ */
+ public void reportSmsMemoryStatus(boolean available, Message result) {
+ RILRequest rr = RILRequest.obtain(RIL_REQUEST_REPORT_SMS_MEMORY_STATUS, result);
+ rr.mp.writeInt(1);
+ rr.mp.writeInt(available ? 1 : 0);
+
+ if (RILJ_LOGD) riljLog(rr.serialString() + "> "
+ + requestToString(rr.mRequest) + ": " + available);
+
+ send(rr);
+ }
+
//***** Private Methods
private void sendScreenState(boolean on) {
@@ -1992,7 +2018,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
case RIL_REQUEST_CONFERENCE: ret = responseVoid(p); break;
case RIL_REQUEST_UDUB: ret = responseVoid(p); break;
case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: ret = responseInts(p); break;
- case RIL_REQUEST_SIGNAL_STRENGTH: ret = responseInts(p); break;
+ case RIL_REQUEST_SIGNAL_STRENGTH: ret = responseSignalStrength(p); break;
case RIL_REQUEST_REGISTRATION_STATE: ret = responseStrings(p); break;
case RIL_REQUEST_GPRS_REGISTRATION_STATE: ret = responseStrings(p); break;
case RIL_REQUEST_OPERATOR: ret = responseStrings(p); break;
@@ -2187,7 +2213,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
case RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM: ret = responseInts(p); break;
case RIL_UNSOL_ON_USSD: ret = responseStrings(p); break;
case RIL_UNSOL_NITZ_TIME_RECEIVED: ret = responseString(p); break;
- case RIL_UNSOL_SIGNAL_STRENGTH: ret = responseInts(p); break;
+ case RIL_UNSOL_SIGNAL_STRENGTH: ret = responseSignalStrength(p); break;
case RIL_UNSOL_DATA_CALL_LIST_CHANGED: ret = responseDataCallList(p);break;
case RIL_UNSOL_SUPP_SVC_NOTIFICATION: ret = responseSuppServiceNotification(p); break;
case RIL_UNSOL_STK_SESSION_END: ret = responseVoid(p); break;
@@ -2205,7 +2231,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
case RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE: ret = responseVoid(p); break;
case RIL_UNSOL_CDMA_CALL_WAITING: ret = responseCdmaCallWaiting(p); break;
case RIL_UNSOL_CDMA_OTA_PROVISION_STATUS: ret = responseInts(p); break;
- case RIL_UNSOL_CDMA_INFO_REC: ret = responseCdmaInformationRecord(p); break;
+ case RIL_UNSOL_CDMA_INFO_REC: ret = responseCdmaInfoRec(p); break;
case RIL_UNSOL_OEM_HOOK_RAW: ret = responseRaw(p); break;
default:
@@ -2391,10 +2417,11 @@ public final class RIL extends BaseCommands implements CommandsInterface {
break;
case RIL_UNSOL_CALL_RING:
- if (RILJ_LOGD) unsljLog(response);
+ if (RILJ_LOGD) unsljLogRet(response, ret);
if (mRingRegistrant != null) {
- mRingRegistrant.notifyRegistrant();
+ mRingRegistrant.notifyRegistrant(
+ new AsyncResult (null, ret, null));
}
break;
@@ -2434,13 +2461,6 @@ public final class RIL extends BaseCommands implements CommandsInterface {
}
break;
- case RIL_UNSOL_OEM_HOOK_RAW:
- if (RILJ_LOGD) unsljLogvRet(response, IccUtils.bytesToHexString((byte[])ret));
- if (mUnsolOemHookRawRegistrant != null) {
- mUnsolOemHookRawRegistrant.notifyRegistrant(new AsyncResult(null, ret, null));
- }
- break;
-
case RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE:
if (RILJ_LOGD) unsljLog(response);
@@ -2452,25 +2472,46 @@ public final class RIL extends BaseCommands implements CommandsInterface {
case RIL_UNSOL_CDMA_CALL_WAITING:
if (RILJ_LOGD) unsljLog(response);
- if(mCallWaitingRegistrants != null) {
- mCallWaitingRegistrants.notifyRegistrants(new AsyncResult (null, ret, null));
+ if (mCallWaitingInfoRegistrants != null) {
+ mCallWaitingInfoRegistrants.notifyRegistrants(
+ new AsyncResult (null, ret, null));
}
break;
case RIL_UNSOL_CDMA_OTA_PROVISION_STATUS:
- if (RILJ_LOGD) unsljLog(response);
+ if (RILJ_LOGD) unsljLogRet(response, ret);
- if (mOtaSessionRegistrants != null) {
- mOtaSessionRegistrants.notifyRegistrants(new AsyncResult(null, ret, null));
+ if (mOtaProvisionRegistrants != null) {
+ mOtaProvisionRegistrants.notifyRegistrants(
+ new AsyncResult (null, ret, null));
}
break;
case RIL_UNSOL_CDMA_INFO_REC:
- if (RILJ_LOGD)
- unsljLog(response);
- if (mInformationRecordsRegistrants != null) {
- mInformationRecordsRegistrants.notifyRegistrants(new AsyncResult(null, ret,
- null));
+ if (RILJ_LOGD) unsljLog(response);
+
+ CdmaInformationRecords infoRec = (CdmaInformationRecords) ret;
+ if (infoRec.isDispInfo) {
+ if (mDisplayInfoRegistrants != null) {
+ if (RILJ_LOGD) unsljLogRet(response, infoRec.cdmaDisplayInfoRecord);
+
+ mDisplayInfoRegistrants.notifyRegistrants(
+ new AsyncResult (null, infoRec.cdmaDisplayInfoRecord, null));
+ }
+ }
+ if (infoRec.isSignInfo) {
+ if (mSignalInfoRegistrants != null) {
+ if (RILJ_LOGD) unsljLogRet(response, infoRec.cdmaSignalInfoRecord);
+ mSignalInfoRegistrants.notifyRegistrants(
+ new AsyncResult (null, infoRec.cdmaSignalInfoRecord, null));
+ }
+ }
+ break;
+
+ case RIL_UNSOL_OEM_HOOK_RAW:
+ if (RILJ_LOGD) unsljLogvRet(response, IccUtils.bytesToHexString((byte[])ret));
+ if (mUnsolOemHookRawRegistrant != null) {
+ mUnsolOemHookRawRegistrant.notifyRegistrant(new AsyncResult(null, ret, null));
}
break;
}
@@ -2721,11 +2762,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
dc.als = p.readInt();
voiceSettings = p.readInt();
dc.isVoice = (0 == voiceSettings) ? false : true;
-
- //dc.isVoicePrivacy = (0 != p.readInt());
int voicePrivacy = p.readInt();
dc.isVoicePrivacy = (0 != voicePrivacy);
-
dc.number = p.readString();
int np = p.readInt();
dc.numberPresentation = DriverCall.presentationFromCLIP(np);
@@ -2834,15 +2872,48 @@ public final class RIL extends BaseCommands implements CommandsInterface {
private Object
responseCDMA_BR_CNF(Parcel p) {
- int numInts;
+ int numServiceCategories;
int response[];
- numInts = p.readInt();
+ numServiceCategories = p.readInt();
+ if (numServiceCategories == 0) {
+ int numInts;
+ numInts = CDMA_BROADCAST_SMS_NO_OF_SERVICE_CATEGORIES * CDMA_BSI_NO_OF_INTS_STRUCT + 1;
+ response = new int[numInts];
+
+ // Indicate that a zero length table was received
+ response[0] = 0; // TODO(Moto): This is very strange, please explain why.
+
+ // Loop over CDMA_BROADCAST_SMS_NO_OF_SERVICE_CATEGORIES set 'english' as
+ // default language and selection status to false
+ for (int i = 1; i < numInts; i += CDMA_BSI_NO_OF_INTS_STRUCT ) {
+ response[i + 0] = i / CDMA_BSI_NO_OF_INTS_STRUCT;
+ response[i + 1] = 1;
+ response[i + 2] = 0;
+ }
+ } else {
+ int numInts;
+ numInts = (numServiceCategories * CDMA_BSI_NO_OF_INTS_STRUCT) + 1;
+ response = new int[numInts];
+
+ response[0] = numServiceCategories;
+ for (int i = 1 ; i < numInts; i++) {
+ response[i] = p.readInt();
+ }
+ }
+
+ return response;
+ }
+
+ private Object
+ responseSignalStrength(Parcel p) {
+ int numInts = 7;
+ int response[];
+
+ /* TODO: Add SignalStrength class to match RIL_SignalStrength */
response = new int[numInts];
-
- response[0] = numInts;
- for (int i = 1 ; i < numInts; i++) {
+ for (int i = 0 ; i < numInts ; i++) {
response[i] = p.readInt();
}
@@ -2850,105 +2921,81 @@ public final class RIL extends BaseCommands implements CommandsInterface {
}
private Object
- responseCdmaInformationRecord(Parcel p){
+ responseCdmaInfoRec(Parcel p) {
+ int infoRecordName;
+ CdmaInformationRecords records = new CdmaInformationRecords();
- int num;
- ArrayList
+ *
*
+ *
+ *
+ *