diff options
| author | RoboErik <epastern@google.com> | 2011-07-08 15:28:26 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-08 15:28:26 -0700 |
| commit | bb594dcdb40cc9df3ec061a753137adcb98ac715 (patch) | |
| tree | fe7fa82d0fafcad06f83d6542c2ec25860ae7429 /core/java/android | |
| parent | 7b588b04f5735fcdc262e0ccf26542fff82de372 (diff) | |
| parent | 3672696dc542674f8b54f83cd00c616b4a9fd4ad (diff) | |
Merge "Unhide CalendarContract apis"
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/provider/CalendarContract.java | 88 |
1 files changed, 80 insertions, 8 deletions
diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java index f9dc257924b8..5b29103e3df7 100644 --- a/core/java/android/provider/CalendarContract.java +++ b/core/java/android/provider/CalendarContract.java @@ -17,6 +17,8 @@ package android.provider; +import android.annotation.SdkConstant; +import android.annotation.SdkConstant.SdkConstantType; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.ContentProviderClient; @@ -83,7 +85,6 @@ import android.util.Log; * adapters</li> * </ul> * - * @hide */ public final class CalendarContract { private static final String TAG = "Calendar"; @@ -92,8 +93,8 @@ public final class CalendarContract { * Broadcast Action: This is the intent that gets fired when an alarm * notification needs to be posted for a reminder. * - * @SdkConstant */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER"; /** @@ -146,6 +147,11 @@ public final class CalendarContract { public static final String ACCOUNT_TYPE_LOCAL = "LOCAL"; /** + * This utility class cannot be instantiated + */ + private CalendarContract() {} + + /** * Generic columns for use by sync adapters. The specific functions of these * columns are private to the sync adapter. Other clients of the API should * not attempt to either read or write this column. These columns are @@ -384,7 +390,7 @@ public final class CalendarContract { * Class that represents a Calendar Entity. There is one entry per calendar. * This is a helper class to make batch operations easier. */ - public static class CalendarEntity implements BaseColumns, SyncColumns, CalendarColumns { + public static final class CalendarEntity implements BaseColumns, SyncColumns, CalendarColumns { /** * The default Uri used when creating a new calendar EntityIterator. @@ -394,6 +400,11 @@ public final class CalendarContract { "/calendar_entities"); /** + * This utility class cannot be instantiated + */ + private CalendarEntity() {} + + /** * Creates an entity iterator for the given cursor. It assumes the * cursor contains a calendars query. * @@ -566,7 +577,13 @@ public final class CalendarContract { * <li>{@link #CAL_SYNC10}</li> * </ul> */ - public static class Calendars implements BaseColumns, SyncColumns, CalendarColumns { + public static final class Calendars implements BaseColumns, SyncColumns, CalendarColumns { + + /** + * This utility class cannot be instantiated + */ + private Calendars() {} + /** * The content:// style URL for accessing Calendars */ @@ -711,9 +728,14 @@ public final class CalendarContract { private static final String ATTENDEES_WHERE = Attendees.EVENT_ID + "=?"; /** + * This utility class cannot be instantiated + */ + private Attendees() {} + + /** * Queries all attendees associated with the given event. This is a * blocking call and should not be done on the UI thread. - * + * * @param cr The content resolver to use for the query * @param eventId The id of the event to retrieve attendees for * @param projection the columns to return in the cursor @@ -1064,6 +1086,11 @@ public final class CalendarContract { "/event_entities"); /** + * This utility class cannot be instantiated + */ + private EventsEntity() {} + + /** * Creates a new iterator for events * * @param cursor An event query @@ -1407,6 +1434,11 @@ public final class CalendarContract { Uri.parse("content://" + AUTHORITY + "/exception"); /** + * This utility class cannot be instantiated + */ + private Events() {} + + /** * The default sort order for this table */ private static final String DEFAULT_SORT_ORDER = ""; @@ -1480,6 +1512,11 @@ public final class CalendarContract { }; /** + * This utility class cannot be instantiated + */ + private Instances() {} + + /** * Performs a query to return all visible instances in the given range. * This is a blocking function and should not be done on the UI thread. * This will cause an expansion of recurring events to fill this time @@ -1632,7 +1669,7 @@ public final class CalendarContract { * time zone for the instances. These settings are stored using a key/value * scheme. A {@link #KEY} must be specified when updating these values. */ - public static class CalendarCache implements CalendarCacheColumns { + public static final class CalendarCache implements CalendarCacheColumns { /** * The URI to use for retrieving the properties from the Calendar db. */ @@ -1640,6 +1677,11 @@ public final class CalendarContract { Uri.parse("content://" + AUTHORITY + "/properties"); /** + * This utility class cannot be instantiated + */ + private CalendarCache() {} + + /** * They key for updating the use of auto/home time zones in Calendar. * Valid values are {@link #TIMEZONE_TYPE_AUTO} or * {@link #TIMEZONE_TYPE_HOME}. @@ -1720,6 +1762,11 @@ public final class CalendarContract { * @hide */ public static final class CalendarMetaData implements CalendarMetaDataColumns, BaseColumns { + + /** + * This utility class cannot be instantiated + */ + private CalendarMetaData() {} } protected interface EventDaysColumns { @@ -1745,12 +1792,17 @@ public final class CalendarContract { private static final String SELECTION = "selected=1"; /** + * This utility class cannot be instantiated + */ + private EventDays() {} + + /** * Retrieves the days with events for the Julian days starting at * "startDay" for "numDays". It returns a cursor containing startday and * endday representing the max range of days for all events beginning on * each startday.This is a blocking function and should not be done on * the UI thread. - * + * * @param cr the ContentResolver * @param startDay the first Julian day in the range * @param numDays the number of days to load (must be at least 1) @@ -1828,9 +1880,14 @@ public final class CalendarContract { public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/reminders"); /** + * This utility class cannot be instantiated + */ + private Reminders() {} + + /** * Queries all reminders associated with the given event. This is a * blocking call and should not be done on the UI thread. - * + * * @param cr The content resolver to use for the query * @param eventId The id of the event to retrieve reminders for * @param projection the columns to return in the cursor @@ -1951,6 +2008,11 @@ public final class CalendarContract { public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/calendar_alerts"); + /** + * This utility class cannot be instantiated + */ + private CalendarAlerts() {} + private static final String WHERE_ALARM_EXISTS = EVENT_ID + "=?" + " AND " + BEGIN + "=?" + " AND " + ALARM_TIME + "=?"; @@ -2190,6 +2252,11 @@ public final class CalendarContract { public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/extendedproperties"); + /** + * This utility class cannot be instantiated + */ + private ExtendedProperties() {} + // TODO: fill out this class when we actually start utilizing extendedproperties // in the calendar application. } @@ -2258,5 +2325,10 @@ public final class CalendarContract { * @hide */ public static final class EventsRawTimes implements BaseColumns, EventsRawTimesColumns { + + /** + * This utility class cannot be instantiated + */ + private EventsRawTimes() {} } } |
