mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 18:45:19 +00:00
0b3e939ac8
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.
29 lines
789 B
Java
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();
|
|
|
|
}
|