session-android/src/org/thoughtcrime/securesms/contacts/ContactIdentityManager.java
Moxie Marlinspike 0b3e939ac8 Improve support for "me" contact.
1) Add >= ICS profile support (the system-supported "me" contact).

2) Improve <= Gingerbread support for me contact by auto-detecting
contacts that have the same number as the SIM card.

3) Tie in identity key import/export support to the "me" contact.

4) Don't display a "me" selection option in preference if it can
be auto-detected.

5) Refactor out the ContactAccessorNewApi back into the base class.
2012-10-22 19:17:08 -07:00

29 lines
789 B
Java

package org.thoughtcrime.securesms.contacts;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import java.util.List;
public abstract class ContactIdentityManager {
public static ContactIdentityManager getInstance(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
return new ContactIdentityManagerICS(context);
else
return new ContactIdentityManagerGingerbread(context);
}
protected final Context context;
public ContactIdentityManager(Context context) {
this.context = context.getApplicationContext();
}
public abstract Uri getSelfIdentityUri();
public abstract boolean isSelfIdentityAutoDetected();
public abstract List<Long> getSelfIdentityRawContactIds();
}