summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2012-06-12 15:17:38 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-06-12 15:17:39 -0700
commit460abe97b06fd42cc37bdebb7f0ad4a7ef0e8bde (patch)
tree455738f02c1e5bcb2c0c65d322ca4bca718e405d /telephony
parentf01f6b6d379c911a2c1e350bc758cea26bfe6d9d (diff)
parent131ecf2b414cbb65cf7d22cc4db41dff58875076 (diff)
downloadframeworks_base-460abe97b06fd42cc37bdebb7f0ad4a7ef0e8bde.zip
frameworks_base-460abe97b06fd42cc37bdebb7f0ad4a7ef0e8bde.tar.gz
frameworks_base-460abe97b06fd42cc37bdebb7f0ad4a7ef0e8bde.tar.bz2
Merge "Add support for Caller Name Display"
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/Connection.java12
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/CdmaConnection.java10
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmConnection.java21
3 files changed, 29 insertions, 14 deletions
diff --git a/telephony/java/com/android/internal/telephony/Connection.java b/telephony/java/com/android/internal/telephony/Connection.java
index 07f90cd..021602f 100644
--- a/telephony/java/com/android/internal/telephony/Connection.java
+++ b/telephony/java/com/android/internal/telephony/Connection.java
@@ -28,6 +28,10 @@ public abstract class Connection {
public static int PRESENTATION_UNKNOWN = 3; // no specified or unknown by network
public static int PRESENTATION_PAYPHONE = 4; // show pay phone info
+ //Caller Name Display
+ protected String cnapName;
+ protected int cnapNamePresentation = PRESENTATION_ALLOWED;
+
private static String LOG_TAG = "TelephonyConnection";
public enum DisconnectCause {
@@ -84,11 +88,11 @@ public abstract class Connection {
public abstract String getAddress();
/**
- * Gets CDMA CNAP name associated with connection.
+ * Gets CNAP name associated with connection.
* @return cnap name or null if unavailable
*/
public String getCnapName() {
- return null;
+ return cnapName;
}
/**
@@ -100,12 +104,12 @@ public abstract class Connection {
}
/**
- * Gets CDMA CNAP presentation associated with connection.
+ * Gets CNAP presentation associated with connection.
* @return cnap name or null if unavailable
*/
public int getCnapNamePresentation() {
- return 0;
+ return cnapNamePresentation;
};
/**
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
index 8fb136e..e013d84 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
@@ -50,7 +50,6 @@ 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
/*
@@ -76,7 +75,6 @@ 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;
@@ -229,14 +227,6 @@ public class CdmaConnection extends Connection {
return address;
}
- public String getCnapName() {
- return cnapName;
- }
-
- public int getCnapNamePresentation() {
- return cnapNamePresentation;
- }
-
public CdmaCall getCall() {
return parent;
}
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmConnection.java b/telephony/java/com/android/internal/telephony/gsm/GsmConnection.java
index c1ad7b3..a879dac 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmConnection.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmConnection.java
@@ -26,6 +26,7 @@ import android.os.SystemClock;
import android.util.Log;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
+import android.text.TextUtils;
import com.android.internal.telephony.*;
@@ -125,6 +126,8 @@ public class GsmConnection extends Connection {
isIncoming = dc.isMT;
createTime = System.currentTimeMillis();
+ cnapName = dc.name;
+ cnapNamePresentation = dc.namePresentation;
numberPresentation = dc.numberPresentation;
uusInfo = dc.uusInfo;
@@ -151,6 +154,9 @@ public class GsmConnection extends Connection {
index = -1;
isIncoming = false;
+ cnapName = null;
+ cnapNamePresentation = Connection.PRESENTATION_ALLOWED;
+ numberPresentation = Connection.PRESENTATION_ALLOWED;
createTime = System.currentTimeMillis();
this.parent = parent;
@@ -437,6 +443,21 @@ public class GsmConnection extends Connection {
changed = true;
}
+ // A null cnapName should be the same as ""
+ if (TextUtils.isEmpty(dc.name)) {
+ if (!TextUtils.isEmpty(cnapName)) {
+ changed = true;
+ cnapName = "";
+ }
+ } else if (!dc.name.equals(cnapName)) {
+ changed = true;
+ cnapName = dc.name;
+ }
+
+ if (Phone.DEBUG_PHONE) log("--dssds----"+cnapName);
+ cnapNamePresentation = dc.namePresentation;
+ numberPresentation = dc.numberPresentation;
+
if (newParent != parent) {
if (parent != null) {
parent.detach(this);