aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/googlecontacts
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2014-04-10 11:07:36 +0300
committerDamian Minkov <damencho@jitsi.org>2014-04-10 11:07:36 +0300
commitdb8071c2d4aba6bee1a02364aea5240ec1b07cbb (patch)
tree9c64349f317ca3c1c660c3270fa4ee70884cf511 /src/net/java/sip/communicator/impl/googlecontacts
parenta278bda96e28d3ff85ae9f269928c1214173fa5d (diff)
downloadjitsi-db8071c2d4aba6bee1a02364aea5240ec1b07cbb.zip
jitsi-db8071c2d4aba6bee1a02364aea5240ec1b07cbb.tar.gz
jitsi-db8071c2d4aba6bee1a02364aea5240ec1b07cbb.tar.bz2
Separates phone number service, to be a service in separate bundle and improves the number matching when searching for phone numbers.
Diffstat (limited to 'src/net/java/sip/communicator/impl/googlecontacts')
-rw-r--r--src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsActivator.java21
-rw-r--r--src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsQuery.java9
2 files changed, 27 insertions, 3 deletions
diff --git a/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsActivator.java b/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsActivator.java
index e061cba..7c33c7d 100644
--- a/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsActivator.java
+++ b/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsActivator.java
@@ -71,6 +71,11 @@ public class GoogleContactsActivator implements BundleActivator
= new HashMap<GoogleContactsSourceService, ServiceRegistration>();
/**
+ * The registered PhoneNumberI18nService.
+ */
+ private static PhoneNumberI18nService phoneNumberI18nService;
+
+ /**
* Returns a reference to a ConfigurationService implementation currently
* registered in the bundle context or null if no such implementation was
* found.
@@ -480,4 +485,20 @@ public class GoogleContactsActivator implements BundleActivator
cssList.remove(found);
}
}
+
+ /**
+ * Returns the PhoneNumberI18nService.
+ * @return returns the PhoneNumberI18nService.
+ */
+ public static PhoneNumberI18nService getPhoneNumberI18nService()
+ {
+ if(phoneNumberI18nService == null)
+ {
+ phoneNumberI18nService = ServiceUtils.getService(
+ bundleContext,
+ PhoneNumberI18nService.class);
+ }
+
+ return phoneNumberI18nService;
+ }
}
diff --git a/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsQuery.java b/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsQuery.java
index b653b95..f37121e 100644
--- a/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsQuery.java
+++ b/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsQuery.java
@@ -208,7 +208,8 @@ public class GoogleContactsQuery
supportedOpSets.add(OperationSetBasicTelephony.class);
// can be added as contacts
supportedOpSets.add(OperationSetPersistentPresence.class);
- homePhone = PhoneNumberI18nService.normalize(homePhone);
+ homePhone = GoogleContactsActivator.getPhoneNumberI18nService()
+ .normalize(homePhone);
detail = new ContactDetail(homePhone,
ContactDetail.Category.Phone,
new ContactDetail.SubCategory[]{
@@ -225,7 +226,8 @@ public class GoogleContactsQuery
supportedOpSets.add(OperationSetBasicTelephony.class);
// can be added as contacts
supportedOpSets.add(OperationSetPersistentPresence.class);
- workPhone = PhoneNumberI18nService.normalize(workPhone);
+ workPhone = GoogleContactsActivator.getPhoneNumberI18nService()
+ .normalize(workPhone);
detail = new ContactDetail(workPhone,
ContactDetail.Category.Phone,
new ContactDetail.SubCategory[]{
@@ -242,7 +244,8 @@ public class GoogleContactsQuery
supportedOpSets.add(OperationSetBasicTelephony.class);
// can be added as contacts
supportedOpSets.add(OperationSetPersistentPresence.class);
- mobilePhone = PhoneNumberI18nService.normalize(mobilePhone);
+ mobilePhone = GoogleContactsActivator.getPhoneNumberI18nService()
+ .normalize(mobilePhone);
detail = new ContactDetail(mobilePhone,
ContactDetail.Category.Phone,
new ContactDetail.SubCategory[]{