/**
   * Adds a rename listener.
   *
   * @param protocolProvider the protocol provider to which the contact was added
   * @param metaContact the <tt>MetaContact</tt> if the new contact was added to an existing meta
   *     contact
   * @param contactAddress the address of the newly added contact
   * @param displayName the new display name
   */
  private void addRenameListener(
      final ProtocolProviderService protocolProvider,
      final MetaContact metaContact,
      final String contactAddress,
      final String displayName) {
    AndroidGUIActivator.getContactListService()
        .addMetaContactListListener(
            new MetaContactListAdapter() {
              @Override
              public void metaContactAdded(MetaContactEvent evt) {
                if (evt.getSourceMetaContact().getContact(contactAddress, protocolProvider)
                    != null) {
                  renameContact(evt.getSourceMetaContact(), displayName);
                }
              }

              @Override
              public void protoContactAdded(ProtoContactEvent evt) {
                if (metaContact != null && evt.getNewParent().equals(metaContact)) {
                  renameContact(metaContact, displayName);
                }
              }
            });
  }
 @Override
 public LoginManager getLoginManager() {
   return AndroidGUIActivator.getLoginManager();
 }