Added presence columns and changed constants to match provider.

Minor changes that don't need a current.xml because they are @hide.
This commit is contained in:
Jeff Sharkey
2009-06-01 20:23:57 -07:00
parent 7c2cfd50a2
commit d530b3ce85
2 changed files with 109 additions and 2 deletions

View File

@@ -165,6 +165,13 @@ public final class ContactsContract {
*/
public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "aggregates");
/**
* The content:// style URI for this table joined with useful data from
* {@link Data} and {@link Presence}.
*/
public static final Uri CONTENT_SUMMARY_URI = Uri.withAppendedPath(AUTHORITY_URI,
"aggregates_summary");
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of
* people.
@@ -367,7 +374,97 @@ public final class ContactsContract {
* Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_URI, phoneNumber);
* }
*/
public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "phone_lookup");
public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(AUTHORITY_URI,
"phone_lookup");
}
/**
* Additional data mixed in with {@link Im.CommonPresenceColumns} to link
* back to specific {@link ContactsContract.Aggregates#_ID} entries.
*/
private interface PresenceColumns {
/**
* Reference to the {@link Aggregates#_ID} this presence references.
*/
public static final String AGGREGATE_ID = "aggregate_id";
/**
* Reference to the {@link Data#_ID} entry that owns this presence.
*/
public static final String DATA_ID = "data_id";
/**
* The IM service the presence is coming from. Formatted using either
* {@link Contacts.ContactMethods#encodePredefinedImProtocol} or
* {@link Contacts.ContactMethods#encodeCustomImProtocol}.
* <p>
* Type: STRING
*/
public static final String IM_PROTOCOL = "im_protocol";
/**
* The IM handle the presence item is for. The handle is scoped to the
* {@link #IM_PROTOCOL}.
* <p>
* Type: STRING
*/
public static final String IM_HANDLE = "im_handle";
/**
* The IM account for the local user that the presence data came from.
* <p>
* Type: STRING
*/
public static final String IM_ACCOUNT = "im_account";
}
public static final class Presence implements BaseColumns, PresenceColumns,
Im.CommonPresenceColumns {
/**
* This utility class cannot be instantiated
*/
private Presence() {
}
/**
* The content:// style URI for this table
*/
public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "presence");
/**
* Gets the resource ID for the proper presence icon.
*
* @param status the status to get the icon for
* @return the resource ID for the proper presence icon
*/
public static final int getPresenceIconResourceId(int status) {
switch (status) {
case AVAILABLE:
return android.R.drawable.presence_online;
case IDLE:
case AWAY:
return android.R.drawable.presence_away;
case DO_NOT_DISTURB:
return android.R.drawable.presence_busy;
case INVISIBLE:
return android.R.drawable.presence_invisible;
case OFFLINE:
default:
return android.R.drawable.presence_offline;
}
}
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of
* presence details.
*/
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/im-presence";
/**
* The MIME type of a {@link #CONTENT_URI} subdirectory of a single
* presence detail.
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im-presence";
}
/**

View File

@@ -18,6 +18,8 @@ package android.provider;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.provider.ContactsContract.Aggregates;
import android.provider.ContactsContract.Data;
/**
* The contract between the social provider and applications. Contains
@@ -152,12 +154,20 @@ public class SocialContract {
public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "activities");
/**
* The content:// style URI for this table filtered to the set of social activities
* The content:// URI for this table filtered to the set of social activities
* authored by a specific {@link android.provider.ContactsContract.Contacts#_ID}.
*/
public static final Uri CONTENT_AUTHORED_BY_URI =
Uri.withAppendedPath(CONTENT_URI, "authored_by");
/**
* The {@link Uri} for the latest social activity performed by any
* contact aggregated under the specified {@link Aggregates#_ID}. Will
* also join with most-present {@link Presence} for this aggregate.
*/
public static final Uri CONTENT_AGGREGATE_STATUS_URI =
Uri.withAppendedPath(AUTHORITY_URI, "aggregate_status");
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of social
* activities.