Merge "Add CANP name and presentation related fields to call"
diff --git a/common/src/com/android/services/telephony/common/Call.java b/common/src/com/android/services/telephony/common/Call.java
index 99b5c32..68b493f 100644
--- a/common/src/com/android/services/telephony/common/Call.java
+++ b/common/src/com/android/services/telephony/common/Call.java
@@ -19,6 +19,8 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import com.android.internal.telephony.PhoneConstants;
+
 /**
  * Class object used across CallHandlerService APIs.
  * Describes a single call and its state.
@@ -50,9 +52,22 @@
         public static final int ONHOLD = 6;
     }
 
+    // Number presentation type for caller id display
+    // normal
+    public static int PRESENTATION_ALLOWED = PhoneConstants.PRESENTATION_ALLOWED;
+    // block by user
+    public static int PRESENTATION_RESTRICTED = PhoneConstants.PRESENTATION_RESTRICTED;
+    // no specified or unknown by network
+    public static int PRESENTATION_UNKNOWN = PhoneConstants.PRESENTATION_UNKNOWN;
+    // show pay phone info
+    public static int PRESENTATION_PAYPHONE = PhoneConstants.PRESENTATION_PAYPHONE;
+
     private int mCallId = INVALID_CALL_ID;
     private String mNumber = "";
     private int mState = State.INVALID;
+    private int mNumberPresentation = PRESENTATION_ALLOWED;
+    private int mCnapNamePresentation = PRESENTATION_ALLOWED;
+    private String mCnapName = "";
 
     public Call(int callId) {
         mCallId = callId;
@@ -78,6 +93,30 @@
         mState = state;
     }
 
+    public int getNumberPresentation() {
+        return mNumberPresentation;
+    }
+
+    public void setNumberPresentation(int presentation) {
+        mNumberPresentation = presentation;
+    }
+
+    public int getCnapNamePresentation() {
+        return mCnapNamePresentation;
+    }
+
+    public void setCnapNamePresentation(int presentation) {
+        mCnapNamePresentation = presentation;
+    }
+
+    public String getCnapName() {
+        return mCnapName;
+    }
+
+    public void setCnapName(String cnapName) {
+        mCnapName = cnapName;
+    }
+
     /**
      * Parcelable implementation
      */
@@ -87,6 +126,9 @@
         dest.writeInt(mCallId);
         dest.writeString(mNumber);
         dest.writeInt(mState);
+        dest.writeInt(mNumberPresentation);
+        dest.writeInt(mCnapNamePresentation);
+        dest.writeString(mCnapName);
     }
 
     @Override
@@ -110,6 +152,9 @@
         mCallId = in.readInt();
         mNumber = in.readString();
         mState = in.readInt();
+        mNumberPresentation = in.readInt();
+        mCnapNamePresentation = in.readInt();
+        mCnapName = in.readString();
     }
 
 }
diff --git a/src/com/android/phone/CallModeler.java b/src/com/android/phone/CallModeler.java
index c70da9a..f309fa0 100644
--- a/src/com/android/phone/CallModeler.java
+++ b/src/com/android/phone/CallModeler.java
@@ -263,6 +263,9 @@
 
                 call = new Call(callId);
                 call.setNumber(conn.getAddress());
+                call.setNumberPresentation(conn.getNumberPresentation());
+                call.setCnapNamePresentation(conn.getCnapNamePresentation());
+                call.setCnapName(conn.getCnapName());
                 mCallMap.put(conn, call);
             }
         }