summaryrefslogtreecommitdiffstats
path: root/src/com/android/dialer/lookup/ContactBuilder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/dialer/lookup/ContactBuilder.java')
-rw-r--r--src/com/android/dialer/lookup/ContactBuilder.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/android/dialer/lookup/ContactBuilder.java b/src/com/android/dialer/lookup/ContactBuilder.java
index b6c85a2d0..069045db2 100644
--- a/src/com/android/dialer/lookup/ContactBuilder.java
+++ b/src/com/android/dialer/lookup/ContactBuilder.java
@@ -259,6 +259,13 @@ public class ContactBuilder {
public String postCode;
public String country;
+ public static Address createFormattedHome(String address) {
+ Address a = new Address();
+ a.formattedAddress = address;
+ a.type = StructuredPostal.TYPE_HOME;
+ return a;
+ }
+
public JSONObject getJsonObject() throws JSONException {
JSONObject json = new JSONObject();
json.putOpt(StructuredPostal.FORMATTED_ADDRESS,
@@ -301,6 +308,12 @@ public class ContactBuilder {
public String phoneticMiddleName;
public String phoneticFamilyName;
+ public static Name createDisplayName(String displayName) {
+ Name name = new Name();
+ name.displayName = displayName;
+ return name;
+ }
+
public JSONObject getJsonObject() throws JSONException {
JSONObject json = new JSONObject();
json.putOpt(StructuredName.DISPLAY_NAME, displayName);
@@ -337,6 +350,13 @@ public class ContactBuilder {
public int type;
public String label;
+ public static PhoneNumber createMainNumber(String number) {
+ PhoneNumber n = new PhoneNumber();
+ n.number = number;
+ n.type = Phone.TYPE_MAIN;
+ return n;
+ }
+
public JSONObject getJsonObject() throws JSONException {
JSONObject json = new JSONObject();
json.put(Phone.NUMBER, number);
@@ -358,6 +378,13 @@ public class ContactBuilder {
public int type;
public String label;
+ public static WebsiteUrl createProfile(String url) {
+ WebsiteUrl u = new WebsiteUrl();
+ u.url = url;
+ u.type = Website.TYPE_PROFILE;
+ return u;
+ }
+
public JSONObject getJsonObject() throws JSONException {
JSONObject json = new JSONObject();
json.put(Website.URL, url);