コード例 #1
0
  public void linkContact(Contact c, long contactId) {
    if (Preferences.isContactLinkCloudStorageEnabled()) {
      Log.e(this.toString(), "Saving a ContactLink to the cloud is not yet supported");
      return;
    }
    Log.v(
        this.toString(),
        "Creating ContactLink from " + c.getTopic() + " to contactId " + contactId);

    ContactLink cl = new ContactLink(c.getTopic(), contactId);
    App.getContactLinkDao().insertOrReplace(cl);

    updateContact(c);
    EventBus.getDefault().postSticky(new Events.ContactUpdated(c));
  }
コード例 #2
0
  public long getContactIdFromLocalStorage(Contact c) {
    ContactLink cl = App.getContactLinkDao().load(c.getTopic());

    return cl != null ? cl.getContactId() : 0;
  }